_nikhilpalli
07/02/2021, 3:15 PM"TRANS_NOT_COMPLETED"
im in dynamic mode and im trying applying time tracking records to the invoice. here is a snippet of my code:
let invoice = record.create({
type:'invoice',
isDynamic:true
});
let fields = [
{
fieldId:'entity',
value:456
},
{
fieldId:'job',
value:458
}
]
for(field of fields) invoice.setValue(field);
var linecount = invoice.getLineCount('time');
if(linecount > 0){
for(let i = 0; i < linecount; i++){
invoice.selectLine({
sublistId:'time',
line:i
});
invoice.setCurrentSublistValue({
sublistId:'time',
fieldId:'apply',
value:true
});
invoice.commitLine({
sublistId:'time'
})
}
}
invoice.save();