Announcements
Hello,
I am looking for a solution in which I want to open a Quick Create form on click of Ribbon Button and on open of Quick Create form I want that some values from the parent record should get mapped to the Quick Create form.
In this all fields mapped successfully except the Multi Option Set field. This field is having 10 options out of which 3 options are selected and the same I want on the Quick Create form of other entity.
Remember I have retrieved a record from the preveious entity using Xrm.WebApi.retrieveRecord and its retrieved data I have in result as follows:
var abc= result["cs_abctype"];
I need to set the same option set values to Quick Create form through
Xrm.Navigation.openForm(entityOptions, formParameters)
Thanks
AR
Hello AR ,
Please refer below thread where I have already provided the solution for your requirement. And for the Multiselect option set please refer below code.
function setField() { var entityFormOptions = {}; entityFormOptions["entityName"] = "contact"; entityFormOptions["useQuickCreateForm"] = true; optionsetValues = [821220000,821220001,821220004]; // declare an arry and provide the optionset values // Set default values for the Contact form var formParameters = {}; formParameters["firstname"] = "Sample"; formParameters["lastname"] = "Contact"; formParameters["fullname"] = "Sample Contact"; formParameters["emailaddress1"] = "contact@adventure-works.com"; formParameters["jobtitle"] = "Sr. Marketing Manager"; formParameters["donotemail"] = "1"; formParameters["description"] = "Default values for this record were set programmatically."; formParameters["ak_multiselect"] = optionsetValues; // Optionset value set // Open the form. Xrm.Navigation.openForm(entityFormOptions, formParameters).then( function (success) { console.log(success); }, function (error) { console.log(error); }); }
Add option set value in an array. and pass it to the field.
Output :
Thank you,
Amit Katariya
Hi AR,
This should be a bug. I tested this before and all type fields could be pre set successfully besides multi-select option. You would better raise a ticket to feedback this.
Hello,
I am looking for a solution in which I want to open a Quick Create form on click of Ribbon Button and on open of Quick Create form I want that some values from the parent record should get mapped to the Quick Create form.
In this all fields mapped successfully except the Multi Option Set field. This field is having 10 options out of which 3 options are selected and the same I want on the Quick Create form of other entity.
Remember I have retrieved a record from the preveious entity using Xrm.WebApi.retrieveRecord and its retrieved data I have in result as follows:
var abc= result["cs_abctype"];
I need to set the same option set values to Quick Create form through
Xrm.Navigation.openForm(entityOptions, formParameters)
Thanks
AR
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156