how change The status of expense report using suite script ?
hi, not able to change the status of “expense report” from pending or approved To REJECTED
I have used the given below script :-
loadExpenseObj=record.load({
type:record.Type.EXPENSE_REPORT,
id:expense_intrnl_id,
isDynamic:true
});
loadExpenseObj.setValue({fieldId:’rejected’,value:true});
loadExpenseObj.setValue({fieldId:’status’,value:’Rejected by Script’});
loadExpenseObj.setValue({fieldId:’statusRef’,value:’ExpRept:E’});
letexpenseInternlID=loadExpenseObj.save();
Either of these should work:
loadExpenseObj.setValue({fieldId:’status’, value:3});
loadExpenseObj.setText({fieldId:’status’, text:’Rejected’});