Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

New Client API in Dynamics CRM V9.0

(0) ShareShare
ReportReport
Posted on by 50

 Can we use Xrm.Utility.getGlobalContext().getQueryStringParameters() instead of Xrm.Page.context.getQueryStringParameters() in CRM v9.0?

*This post is locked for comments

  • Suggested answer
    Linn Zaw Win Profile Picture
    Linn Zaw Win 3,407 on at
    RE: New Client API in Dynamics CRM V9.0

    Even though I couldn't find official documentation, you can use Xrm.Utility.getGlobalContext().getQueryStringParameters() to pass the custom parameters.

    Here's the sample code.

    //Code from the parent form which is opening quick create form
    var entityFormOptions = {};
    entityFormOptions["entityName"] = "contact";
    entityFormOptions["useQuickCreateForm"] = true;
    var formParameters = {};
    formParameters["firstname"] = "Sample";
    formParameters["lastname"] = "Contact";
    formParameters["description"] = formContext.getAttribute("description").getValue();
    formParameters["test_parameter"] = "Test parameter from main form";
    Xrm.Navigation.openForm(entityFormOptions, formParameters);
    
    
    //OnLoad of Quick Create form to access the custom parameter from the parent form
    var queryString = Xrm.Utility.getGlobalContext().getQueryStringParameters();
    if (queryString["test_parameter"] !== null)
    {
       Xrm.Navigation.openAlertDialog(
       {
           text: queryString["test_parameter"]
       }, null);
    }

  • VENKY KOLAGANI Profile Picture
    VENKY KOLAGANI 270 on at
    RE: New Client API in Dynamics CRM V9.0

    Refer the below sample code to read custom parameter tabname (string). 

    if(formContext.data.attributes){
    if(formContext.data.attributes.get("parameter_tabname")){
    var tabname = formContext.data.attributes.get("parameter_tabname").getValue();
    if(tabname!=null && tabname!=""){
     console.log(tabname);
    }
    }
    }

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: New Client API in Dynamics CRM V9.0

    Try using formContext.data.attributes to get the query string parameters in D365 v9 forms/entities.

  • PM3 Profile Picture
    PM3 50 on at
    RE: New Client API in Dynamics CRM V9.0

    Thank you HIMBAP!

    We tried Xrm.Page.context.getQueryStringParameters() to get query string parameters on html page and we are getting result which we were looking for. But in Unified Interface we are not getting results by using Xrm.Page.context.getQueryStringParameters() and we also tried window.location.search, however we are not getting result in UCI which we want. Can you advise how I can get query parameters in UCI?  

    Thanks in advance!

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: New Client API in Dynamics CRM V9.0

    Ohh if you are working with html then using Xrm.Utility's one should be good.

    Thanks

  • PM3 Profile Picture
    PM3 50 on at
    RE: New Client API in Dynamics CRM V9.0

    Thanks for reply !

    But we are opening html web resource on application ribbon button click. On that page we are using above part. What we can use to get querystringparameteres on html page when opening from application ribbon button?

    Earlier we were using Xrm.Page.context.getQueryStringParameters(). We found the replacement for that is Xrm.Utility.getGlobalContext().getQueryStringParameters() to get querystringparameteters for CRM9.0. Can we use the same in CRM 9.0?

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: New Client API in Dynamics CRM V9.0

    Based on the documentation there is no getQueryStringParameters anymore.

    The getQueryStringParameters has been replaced by formContext.data.attributes:

    The formContext.data.attributes API will make retrieval of non-entity bound data consistent across entity forms, metadata-driven dialogs, and task-based flows. The data will be a combination of custom values sent using the query string and what was specified in the parameters in the openForm method.

    See deprecated client api functions:

    docs.microsoft.com/.../important-changes-coming

    Hope this helps.

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: New Client API in Dynamics CRM V9.0

    Hi,

    You can try this:

    var formContext=executionContext.getFormContext();

    var queryStringParameters=formContext.context.getQueryStringParameters();

    Thanks

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans