hi guys, getting a error TypeError: Cannot read property "length" from null (update_deposit_application.js$188712#19)
The script is just to Edit/Save the Deposit Application
function updateDAStatus(){
var depApp = nlapiSearchRecord("transaction",null,
[
["type","anyof","depositapplication"],
"AND",
["datecreated","onOrAfter","2021/12/01 12:00 am"],
"AND",
["amountremaining","greaterthan","0"]
],
[
new nlobjSearchColumn("internalid").setSort(true)
]
)
//var depAppSearch = [15613395, ];
var resultGet;
var Id;
nlapiLogExecution('DEBUG','depApp.length',depApp.length);
for(var i=1;i<=depApp.length;i++){
/*resultGet = depApp[i];
Id = resultGet.getId();*/
Id = depApp[i];
//nlapiSubmitField('invoice',Id,'taxitem','625069');
var depRcd = nlapiLoadRecord ( 'depositapplication , Id' );
var depId = nlapiSubmitRecord ( depRcd , false , true );
nlapiLogExecution('DEBUG','Id updated',depId);
}
}
What am I doing wrong?