Hi, how to tell form type (quick create or entity form) through javascript?
*This post is locked for comments
Hi, how to tell form type (quick create or entity form) through javascript?
*This post is locked for comments
Try to use Xrm.Utility.getGlobalContext().getQueryStringParameters().pageType method.
If we try to create the record through Quick Create the output is : quickcreate
If we are using Main forms then output is : entityrecord
Try to validate this using console
There is no real way using an SDK function to tell the difference between the forms using regular SDK functions.
You are probably able to get that functionality by checking values of particular fields.
For example the quick create form will not have a particular field. You can check if that field returns a value, and based on that know on which form you are.
Hi, Aric,
I understand that. I have both entity form and quick create form, so when I open either form, it always returns 1 , but I can not tell whether it is quick create or entity form
Hi,
Use Xrm.Page.ui.getFormType() to get the Form Type.
The result of 1 will be FORM TYPE CREATE.
If you have Quick Create enabled on the form, then when the Quick Create is open you will get the result of FORM TYPE CREATE. If you do not have Quick Create enabled, then the Entity form will result in one if this is a new form, and not an Update form.
Hope this helps.
André Arnaud de Cal... 291,711 Super User 2024 Season 2
Martin Dráb 230,458 Most Valuable Professional
nmaenpaa 101,156