RE: Sublist Suitescript – Accessing Parent Form Fields
Hi – I have a script which is creating a sublist on a transaction form.
I want to get a value of a field on the transaction form
function beforeLoadSublist(type, form, request) { form.getFieldValue('entityid') }
But it doesn’t work because of error:
Cannot find function getFieldValue in object nlobjForm.
Not sure how to access to object of the parent record on which the sublist script is deployed.
Have you tried using something like:
var recID = context.newRecord.id; var currentRec = record.load({ type: record.Type.SALES_ORDER, //whatever your transaction type is id: recID, isDynamic: true }); var entity = currentRec.getValue({ fieldId: 'entity' });
I haven’t tested this either, but it’s worth a shot. Hopefully this works or is useful!