RE: Is there any way to modify the fields filled by a flow in a quick creation form?
Hi ramirop,
It is pre-defined system functionality: when opening Quick Create Contact form from Lead form, only some OOB fields will be automatically filled. Therefore, custom script is required if we want to populate other custom fields.
For example, my Lead entity has a custom field "Custom lead field", and Contact has a corresponding field "Custom contact field", I want to fill the contact's field with the value of the lead.
1. Open Lead main form, run the first function setValsForQuickCreate at OnLoad event of the form.
It will create a global window property to store the value of lead.
function setValsForQuickCreate(executionContext) {
var formContext = executionContext.getFormContext();
window.top.attribute1 = formContext.getAttribute("new_customleadfield").getValue();
}
2. Open Contact Quick Create form, also run the second function setValFromMainForm at OnLoad event of the form.
It will fill the contact field with the stored value.
function setValFromMainForm(executionContext) {
var formContext = executionContext.getFormContext();
if (typeof window.top.attribute1 !== 'undefined') {
formContext.getAttribute("new_customcontactfield").setValue(window.top.attribute1);
}
}
Result:
As well as other OOB fields, the custom field will also get populated.
Note: Function 1 and function 2 can be put into same JScript web resource.
Regards,
Clofly