RE: Fill custom field using Export in Excel Online
Hello,
Please refer below JS which will run when your Lead is Qualified or Disqualified.
As you can see the default Value of Qualified and Disqualified status code is from 3 to 7.
So the given JS will run on load of a form as well as on change of Multiselect field and will save it automatically.
function multiselectOption(executionContext)
{
debugger;
var formContext = executionContext.getFormContext();
var status;
if(formContext.getAttribute("statuscode").getValue() != null)
{
status = formContext.getAttribute("statuscode").getValue();
if(status == 3 || status == 4 || status == 5 || status == 6 || status == 7)
{
formContext.data.entity.save();
}
}
}
function onload_multiselectOption(executionContext)
{
debugger;
var formContext = executionContext.getFormContext();
formContext.getControl("ak_multi").setDisabled(false);
}
Go to the Lead form and register your JS here my JS name is "ak_AccountJS".
Then add "onload_multiselectOption" function onload of lead form. Also pass execution context to it.
Then add "multiselectOption" function on change of the multiselect field. this function will save it automatically because we don't have save button for read only records. also pass execution context to it.
after registering the JS make sure to publish the form and close your browser/ clear the cache.
There is a small thing where you will have to load your lead once it is qualified/disqualified, because we don't have status code trigger point we have to load/refresh the browser so that our JS will make multiselect field as editable, once you edit the field it will automatically saves it self.
Thank you,
Amit Katariya