Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

How to know if opened form is quick create form from JavaScript?

(0) ShareShare
ReportReport
Posted on by 10

I used Xrm.Utility.getGlobalContext().getQueryStringParameters().pageType to check form type, but getQueryStringParameters() looks like deprecated. I don't see the needed in formContext.data.attributes. I've seen ways with additional boolean entity field, checking if there is confirm button that is on quick create form or if there is no some field. Are there any other ways that more like using build-in function?

  • Verified answer
    meelamri Profile Picture
    13,216 User Group Leader on at
    RE: How to know if opened form is quick create form from JavaScript?

    Hi,

    you can get this information by performing a retrieve on the systemForm table using the GUID of the current form.

    To get the GUID of the current form, you can use the following code:

    formItem = formContext.ui.formSelector.getCurrentItem();

    formItemId = formItem.getId();

    You can retrieve the form details by using the following code:

    Xrm.WebApi.retrieveRecord('systemform', "f7d3b417-6220-42ac-9aec-228621129f3b", "?$select=type").then(
        function success(result) {
            console.log(result)
            
        },
        function (error) {
            console.log(error.message);
            // handle error conditions
        }
    );
    

    Result: 

    7713.pastedimage1629971471641v1.png

    Good luck !

  • Verified answer
    Pradeep Rai Profile Picture
    5,487 Super User 2025 Season 1 on at
    RE: How to know if opened form is quick create form from JavaScript?

    Hi,

    I would suggest two ways.

    1. CRM Function - In our script we can write below code to get formType:

    Code:

    function onLoad(executionContext)

    {

      var contextObj=executionContext.getContext();

     var pageType=contextObj.getQueryStringParameters().pageType

    }

    7840.pastedimage1629957745404v1.png

    This is best way to achieve this.

    2. Add one more parameter in script function and while registering the script pass the formName as:

    function onLoad(executionContext,formType){

    }
    5657.pastedimage1629958095473v2.png

  • Ram Prakash Profile Picture
    2,287 on at
    RE: How to know if opened form is quick create form from JavaScript?

    Hello,

    You can use formContext.context.getQueryStringParameters().pageType

    Link for your reference :

    docs.microsoft.com/.../gg334511(v=crm.7)

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: How to know if opened form is quick create form from JavaScript?

    Hi,

    You can use this code to get it: formContext.context.getQueryStringParameters().pageType .

    Result:

    6765.pastedimage1629946853475v1.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 181 Super User 2025 Season 1

#2
Siv Sagar Profile Picture

Siv Sagar 149 Super User 2025 Season 1

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 124 Super User 2025 Season 1

Product updates

Dynamics 365 release plans