Xrm.navigation.openform Not Honouring Formid
Solution 1:
That's looks like mistake in docs or bug in Dynamics.
Previous implementation (v8 and before) took formid in parameters object: https://msdn.microsoft.com/en-us/library/jj602956.aspx#openEntityForm
Although current documentation states that formId must be set in entityFormOptions it isn't actually honoured. But it is honoured when you put it to good old formParameters.
Thus this does the trick:
var entityFormOptions = {};
entityFormOptions["entityName"] = "contact";
var formParameters = {};
formParameters ["formid"] = "375DE297-C0AF-4711-A811-5F1663FAE5DA";
Xrm.Navigation.openForm(entityFormOptions, formParameters);
P.S. Note that lowercase "formid".
Solution 2:
This may be a little late but hopefully will help someone else.
The documentation is correct. You can supply formId as shown. You only need to make sure that form is added to the Model Driven App in App Designer (You add the form by checking it on the panel on the right)
var pageInput = {
pageType: "entityrecord",
entityName:"icon_case",
entityId: recordId,
formId: v_formId
};
Solution 3:
we can also use the below code to open a particular entity form:
var entityFormOptions = {};
entityFormOptions["entityName"] = "nrw_contact";//Logical name of the entity
entityFormOptions["entityId"] = "nrw_contact_ID"; //ID of the entity record
entityFormOptions["formId"] = "CF8D885B-256D-43E6-8776-CBBB7AA88EF5"; //FormId
Xrm.Navigation.openForm(entityFormOptions);
Please refer this link for more details : https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-navigation/openform
Post a Comment for "Xrm.navigation.openform Not Honouring Formid"