I have a design where same page could be called to add a record, as part of the similar drop downs on the same page.
Based on a Boolean field value the behavior of the opened page should adapt.
Screen shot from calling page
Both + sign on Payer Account dropdown and Payee Account dropdown should go to a common page where organization account or person account is created. On the account creation page based on a Boolean field value account should be created for either registered organizations or registered contacts.
But when I configure page, I cannot pass Boolean value as the only setting is to "Establish relationship with new records" only accepts IDs.
To overcome this I created two new pages, one for payee and another for payer.
On the Payments page (parent/calling page) created three events onload_after, "organization_is_payer_changed" and "organization_is_payee_changed" and in these I set the values of these booleans
app.value_store_set("payer_is_organization", app.get_field_value({F5: 0 fmpayments.organizationispayer}));
app.value_store_set("payee_is_organization", app.get_field_value({F8: 0 fmpayments.organizationispayee}));
Now I wanted to reset the value_store with the following statements
app.value_store_set("payer_is_organization", undefined);
app.value_store_set("payee_is_organization", undefined);
I would have preferred to call the trigger on form_unload, but unfortunately the only events available for forms are loaded, record_saved, record_deleted. I could exit page without saving or deleting the record and hence if I reset the value_store in these events it won't even get called and hence the value store will not be emptied...
Where should I clear the value_store?
Cheers
Francis