Has anyone had issues using the getSublistField AP...
# suitescript
m
Has anyone had issues using the getSublistField API in 2.0? We’re using this API as part of a field changed client script that repopulates the sublist field list values. The code below errors out due to the line not having been committed yet. Here, idx = the sublist index. Thanks in advance! var binsField = suiteletRecord.getSublistField({ sublistId: ‘custpage_sub’, fieldId: ‘custpage_bin’, line: idx });
n
is the sublist a custom record?
m
The sublist is part of a suitelet.
b
You are probably better off hardcoding idx to 0
m
We tried hardcoding to 0, but still getting the error
b
what does the suitelet code for that field look like?
in general, the only time i've seen error getting sublist fields is when trying to modify a field when there are no lines committed yet
d
battk is correct, the field technically doesn't exist unless there's at least one committed line. It's a pain in the arse really. Depending on what you're wanting to do with the field, you could access the DOM via jQuery, but avoid if you can
b
i dont think thats actually the case, nlapiGetLineItemField works without committed lines