Hi.. am facing an issue to get the bill date from ...
# suitescript
s
Hi.. am facing an issue to get the bill date from billingscedule in 2.0 whereas its working in 1.0 1.0 :var billDate = soRec.getLineItemValue('billingschedule', 'billdate', linePos); 2.0 :var billDate = currRec.getSublistValue({sublistId: 'billingschedule',fieldId: 'billdate',line: linePos}); what is the issue in the above 2.0 code? am getting blank date.
n
Are you moving the code from SS1.0 to SS2.0 or is this a new script and you're just showing differing API code as an example? If you are moving, double check the line index, you probably already know but in case not, sublists are zero indexed in SS2.0, perhaps you only have one line and are accidentally looking at line:1 ?
s
Also I would
Number(linePos)
, sometimes I have seen inputting strings cause errors.
👍 1
s
@NElliott Yes. Am migrating the userevent script from 1,0 to 2.0 . Actually I was using 0 in the line index first and it didnt work. Only then i changed it to 1.. let me check again with 0
@Sandii thanks for info .. will try that
the issue seems to be that the sublists are not accessible in context.currrec in aftersubmit event. I need to load the record to get the sublists.. is that true?