Page 1 of 1

Set value of subform object

Posted: Thu Apr 27, 2023 7:46 pm
by treed
I see how to use JS to get the value of a subform object. How could one set the value of a subform object?

I've got an invoice line item with tiered pricing. Right now if the users enters the quantity and selects an item and the correct pricing is retrieved and placed in the row. However if someone changes the quantity I need to see where this new value fits within the tiers and change the pricing on the row.

Also on the Wiki, the nuSetValue section shows the structure for nuGetValue.

Re: Set value of subform object

Posted: Thu Apr 27, 2023 8:02 pm
by kev1n
Add an onchange event to the quantity field that updates the corresponding price value in the same row. In the provided example, '12345' is the current value set for the quantity field (the correct price must be retrieved somehow)

Code: Select all

nuSubformRowObject(event.target.id, 'your_prive_id').val('12345');