RE: Pull data to ‘add new popup’ from the originating record in create mode
We have 2 custom records from a SuiteApp that our client has purchased.
In custom record 1, we have 2 drop down list fields for customer and for contract,
In create mode, a customer is selected. If the customer does not already have a contract, we have to add it. We do so using the ‘+’ button next to the contract field.
This opens our custom record 2: contract. Here we have a field for customer and some contract data fields.
Our client wants the customer entered in the 1st custom record to automatically follow to the contract and populate the customer field there.
Is this even possible? Since we are in create mode we do not have an id for the 1st custom record so we cannot just add a field to the contract that is linked to the 1st custom record and pull the data that way.
I was considering session.set and session.get, But I can only do that with a server side script.. And I need a client script to notice the field change on customer in custom record 1.
You can use window.opener from a client script deployed on the second record to access the window of the parent record. From there, you can use window.opener.require() to access N/currentRecord of the opener window, which would be the currentRecord of record 1.