I am passing search results from getinputdata to map stage using return. Ho can i pass recordid and script id to map? Please help!
function getInputData() {
try {
var scriptObj = runtime.getCurrentScript();
var scriptId = runtime.getCurrentScript().id;
var recordId = runtime.getCurrentScript().getParameter({
name: 'custscript_record_id'
});
log.debug("scriptId",scriptId);
if(recordId)
{
var searchID = 'customsearch_je';
//log.debug("searchID", searchID);
var searchObj = search.load(searchID);
searchObj.filters.push(search.createFilter({
name: 'internalidnumber',
operator: search.Operator.EQUALTO,
values: recordId
}));
}
else
{
var errorSearchID = 'customsearch_je_error';
log.debug("errorSearchID", errorSearchID);
searchObj=search.load(errorSearchID);
}
return getMoreRecords(searchObj),scriptId;
} catch (error) {
log.error("Error in getInputData", error);
}
}
You have 2 solutions for that:
The first option is easier.