[Email Merge pop-up] On the project form, we have...
# suitescript
d
[Email Merge pop-up] On the project form, we have the option 'Create New Email' in the form of menu. The option opens a pop-up screen where user fills the all data for mail. The client wants to modify this popup. For example, based on some fields data on project, some data must be pre-filled in that pop-up window. In my opinion, this is not possible. The solution to re-create this window and add the standard/custom behaviors to it. Am I correct or missing something?
e
Actually,
message
is a scriptable record
d
Thank you for pointing out this information. But the problem is still that we cant use the form to populate the fields before loading
e
Why not @Damree Ilyaad? You have a reference to the
entity
(ID: 8142 in your screenshot) and from there you can perform whatever lookups you wish in the
beforeLoad
entry point. No?
What exactly were you looking to set? Which fields and where do the values come from?
d
I simplified the scenario in the thread. The story is: I will have a custom button in projects. The custom button will open a custom popup where i will select a template. Once I click submit, the standard Email popup is opened and with some values from the template. A UserEventscript with beforeload event can prefill the fields but how to open that form first from another form ?
e
Aha, so you have a “template” which is a form I guess that provides your email message record basic values to include. I would suggest crafting the link on your form via
url.resolveRecord
which allows you to specify
params
as a parameter, which is where you’ll include parameters for your Email Message record. custpage_fieldvalue1, custpage_fieldvalue2 (bad names, but I don’t know what you are collecting from your template). Make sense?
Your
beforeLoad
event will have access to the request parameters I believe
scriptContext.request.parameters.custpage_fieldvalue1
d
unfortunately I cant use
url.resolveRecord.
This method is used to open a saved record by providing the internal Id. In my scenario, my custom form (suitelet) must open the standard Email popup form in create mode.