Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to get Query String Parameters value from formContext.data.attributes

Posted on by Microsoft Employee

client APIs 'Xrm.Page.context.getQueryStringParameters' is deprecated with 

formContext.data.attributes. I wan to have an example to get Query String Parameters value from formContext.data.attributes.

*This post is locked for comments

  • Suggested answer
    BifyAbraham Profile Picture
    BifyAbraham 20 on at
    RE: How to get Query String Parameters value from formContext.data.attributes

    Hi amlesh, 

    I was able to access the form parameter as using the below code. Hope this helps. 

    item.getName() gives the name of the parameter and item.getValue() gives the values that are passed to that parameter 

    var c = formContext.data.attributes;
    c.forEach(function myfunc(item, index) {
    alert(item.getName() + " " + item.getValue());

    });

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: How to get Query String Parameters value from formContext.data.attributes

    Gentlemen,

    I experienced issues similar to yours and here is solution - butenko.pro/.../

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get Query String Parameters value from formContext.data.attributes

    @SRISAI Even i am facing same issue

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get Query String Parameters value from formContext.data.attributes

    Hi Shaminderpal 

    when i use Xrm.Utility.getGlobalContext().getQueryStringParameters() 

    Console output: {appid: "xxxxxx-xxxxxx-xxx-xxxxx", data: "xxxxxx"}

    data= displays the passed parameters under custom parameters of Web Resource Properties

    ___________________________________________________________________________________________________________

    [But in unified interface it behaves different]

    Console output: {entityTypeName: "contact", id: "{xxxxx-xxxxxx-xxxxx-xxxx-xxxxx", pageType: "entityrecord"}

    I donot see anythinh that says data.

    Can someone help me fixing this issue in Unified interface? in old ui app the same code works fine.

  • Ty8080 Profile Picture
    Ty8080 156 on at
    RE: How to get Query String Parameters value from formContext.data.attributes

    Thanks Shaminderpal

  • Ty8080 Profile Picture
    Ty8080 156 on at
    RE: How to get Query String Parameters value from formContext.data.attributes

    Hi all,

    Shaminderpal Singh's solution was all that worked for me. I have had continued issues getting query string parameters via formContext.data.attributes. I will post back once i have had success but i will be adding

    Shaminderpal's solution into my scripts for now.

  • Viswanath Profile Picture
    Viswanath 90 on at
    RE: How to get Query String Parameters value from formContext.data.attributes

    Hello Amleshsng,

    any updates on this how passed query string parameters and read it using formContext.data.attributes ? 

    Thanks in Advance.

    viswa

  • Verified answer
    Shaminderpal Singh Profile Picture
    Shaminderpal Singh 1,565 on at
    RE: How to get Query String Parameters value from formContext.data.attributes

    Hi ,

    You can get it using below:

    Xrm.Utility.getGlobalContext().getQueryStringParameters()

    -Shaminder

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: How to get Query String Parameters value from formContext.data.attributes

    Hi,

    I have some doubt I really could not found any documentation how to use it  ,  try with this -

    formContext.data.attributes("AttributeName")

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans