Hi,
I have the below scenario.
I created a custom module called âDemosâ.
Then, I created a one-to-one relationship between âDemosâ and âAccountsâ modules.
When a user creates a new Demo record, I need to access some Account recordâs fields
before the Demo record is saved.
The related account recordâs fields will be used to populate some Demo recordâs fields.
Approach 1:
I attached a âbefore_relationship_addâ logic hook on Demoâs editview page.
Unfortunately, the above hook is called, after the Demo record is saved.
So, I cannot use it.
Approach 2:
I used javascript to listen to changes/clicks on âaccounts_demosâ input field on Demoâs editview page.
Then, I would post an AJAX request to fetch related Account recordâs fields.
Unfortunately, âaccounts_demosâ input field is not fired when âaccounts_demosâ popup closes (it fires send_back(âŚ) function to set the field to editview page).
Can someone please provide a solution to the problem that I face?
Thanks in advance.