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.

 

Rookie Asked on March 10, 2022 in SuiteScript.
Add Comment
1 Answer(s)

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!

Rookie Answered on March 16, 2022.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor