Hi All,
In a oneworld environment
I have a suitelet which creates statistical JE but i got following error while submitting the Statistical JE record.
Code: UNEXPECTED_ERROR Details: ReferenceError: "pp_ss" is not defined. (INVOCATION_WRAPPER#9)
below is my code
function createStatisticalJE(subsidiary){
var mappings = loadMappings();
if(mappings){
var rec = nlapiCreateRecord('statisticaljournalentry');
rec.setFieldValue('approved','T');
rec.setFieldValue('trandate',getDate());
rec.setFieldValue('unitstype',mappings[0].getValue('custrecord_uom'));
rec.setFieldValue('custbody_report',report);
rec.setFieldValue('subsidiary',subsidiary);
for(var i=0; i<mappings.length; i++){
var account = mappings[i].getValue('custrecord_statistical_account');
var savedSearch = mappings[i].getValue('custrecord_saved_search');
var summaryColumn = mappings[i].getValue('custrecord_summary_column');
var summaryType = mappings[i].getValue('custrecord_summary_type');
var searchValue = loadSearch(savedSearch,summaryColumn,summaryType);
nlapiLogExecution('DEBUG','searchValue',searchValue);
nlapiLogExecution('DEBUG','account',account);
rec.setLineItemValue('line','account',i+1,account);
rec.setLineItemValue('line','debit',i+1,searchValue);
rec.setLineItemValue('line','lineunit',i+1,mappings[0].getValue('custrecord_uom'));
rec.commitLineItem('line');
nlapiLogExecution('DEBUG','uom',mappings[0].getValue('custrecord_uom'));
}
nlapiSubmitRecord(rec);
}
}
Please reply ASAP
Regards,
Mirza Imran Ali Baig