In a Entity i have 3 form like Form 1,Form 2,Form 3. The Form 1 is a default Form.
In ribbon I have "Swap Form " Custom Button. Now i Click on this button i need to change the Form 1 to Form 2.
I use the following code,
Xrm.Utility.openEntityForm(name,id,parameters,windowOptions)
Its opening in the new window i don't want like this open in a new window.I need to swap the Form 1 to Form 2.
Any Idea ? Thanks in advance .
*This post is locked for comments
Use below code:
function buttonClick(){ var lblForm = "Form 1"; //check if the current form is form need to be displayed based on the value if (Xrm.Page.ui.formSelector.getCurrentItem().getLabel() != lblForm) { var items = Xrm.Page.ui.formSelector.items.get(); for (var i in items) { var item = items[i]; var itemId = item.getId(); var itemLabel = item.getLabel() if (itemLabel == lblForm) { //navigate to the form item.navigate(); } //endif } //end for } //endif }
I need to open the specific form while click the button. In my entity "Form1" is default. but Form2 ,form 3 are available.If I use the above code its opening "Form1" because its a default form.But I need to open "Form 2" on button click .
@mohd saad akhtar I need to open the specific form while click the button. In my entity "Form1" is default. but Form2 ,form 3 are available.If I use the above code its opening "Form1" because its a default form.But I need to open "Form 2" on button click.
Hi Vijay,
windowsOptions is the option which controls whether form needs to be opened in the new window or in the same window. The default value for this parameter is false, if wants to open in new window then we need to specify a true value for this parameter. It is an optional parameter which can be omitted.
For more details on this function, please refer the blog below.
https://mahadeomatre.blogspot.in/2016/10/xrmutility-functions-openentityform.html
Hope this helps you.
Remove windowoptions from the line:
Xrm.Utility.openEntityForm(name,id,parameters)
Refer this:
http://www.magnetismsolutions.com/blog/gayanperera/2013/07/24/how-to-switch-a-dynamics-crm-form-based-on-a-value
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156