Getting the body of the message of an inbound email using SuiteScript.
Run the script below in the debugger:
//filter
//76 is the internal id of the case record
var arrSearchFilters = new Array();
arrSearchFilters[0] = new nlobjSearchFilter('internalid', null, 'is', 76);
//columns
var arrSearchColumns = new Array();
//internalid = internal id of the message
//message= body of the message
arrSearchColumns[0] = new nlobjSearchColumn('message','messages');
arrSearchColumns[1] = new nlobjSearchColumn('internalid','messages');
var arrSearchResults = nlapiSearchRecord('supportcase','null',arrSearchFilters,arrSearchColumns);
for (var i in arrSearchResults)
{
var searchResult = arrSearchResults[i];
var message= searchResult.getValue(arrSearchColumns[0]);
var internalID= searchResult.getValue(arrSearchColumns[1]);
nlapiLogExecution('DEBUG','internalID',internalID);
nlapiLogExecution('DEBUG','message',message);
}
var x=00;
No comments:
Post a Comment