Hi All. Apex 5.1.3
I have a main page. I click a popup, and it opens a first Modal Dialog Page to select values, that I eventually want to pass back to items on the first page. I have a second Modal Dialog that is opened by a button the first Modal dialog page . This is affectively a search dialog to optionally complete the items on the first dialog.
No matter what I try, I cannot get the values to pass back from the second dialog to the first, and the first to the main page.
Ive tried Java, with setting . Ive tried setting values in session state, Ive tried every option that Chat GPT throws at me, and I still cannot get the values transferred.
Ive tried doing this by transferring using the following:
var selectedValue = $v('P2_ITEM'); // Replace 'P2_ITEM' with the ID of the item in the second dialog box
apex.event.trigger(window.parent.document, 'set-value', selectedValue);
apex.navigation.dialog.close();
Receive the Value in the First Dialog Box:
• In the first dialog box, create a dynamic action to handle the custom event triggered by the second dialog box.
• Event: Custom
• Custom Event: set-value
• Selection Type: JavaScript Expression
• JavaScript Expression: window
• True Action: Execute JavaScript Code
If someone can advise on how I can get this working, Id be really grateful.
Many Thanks
Richard