I have written a client script on invoice record
function autofillTaxDetails(context){
try{
var currRec=context.currentRecord;
var taxdetailsoverrideu=currRec.getValue('taxdetailsoverride');
if(taxdetailsoverrideu == true){
var lc=currRec.getLineCount('taxdetails');
var autoFill=currRec.getValue('custbody_ctl_autofilltaxdetails');
log.debug('lc===>',lc);
if (lc > 0){
var taxrate=currRec.getSublistValue({
sublistId:'taxdetails',
fieldId:'taxrate',
line:0
});
log.debug('taxrate',taxrate);
var taxamount=currRec.getSublistValue({
sublistId:'taxdetails',
fieldId:'taxamount',
line:0
});
log.debug('taxamount',taxamount);
}
if (autoFill == true){
log.debug('start time');
for(var i=1; i< lc; i++){
// log.debug('enter in loop');
currRec.selectLine({
sublistId: 'taxdetails',
line: i
});
currRec.setCurrentSublistValue({
sublistId: 'taxdetails',
fieldId: 'taxamount',
value:taxamount
});
currRec.setCurrentSublistValue({
sublistId: 'taxdetails',
fieldId: 'taxrate',
value:taxrate
});
currRec.commitLine({
sublistId: 'taxdetails'
});
}
log.debug('end time');
}
}
}
catch(e){
log.debug(e.name,e.message);
}
}
this is my script on "save record" function.After executing this for more than 100 lines my page becomes unresponsive.
Is there any other way I can achieve?