When the record is loaded and trying to add a new sublist line will not work when the record is loaded in the standard mode. That is, an error of ‘TypeError: objRecord.selectNewLine is not a function’. In order to resolve the error, load the record in dynamic mode.
record.load({
type: record.Type.SALES_ORDER,
id: icrId,
isDynamic: true,
});
Similarly, when trying to get a field value using the currentRecord.get() function which is in view mode may not actually fetch the value. So, loading the record in dynamic mode and getting the value may solve the issue.