Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

How do I get the parent id in Unified Interface mode?

(0) ShareShare
ReportReport
Posted on by 95

In a legacy web environment, I previously used javascript to get the parent ID from the querystring, i.e.

            var queryString = window.parent.Xrm.Page.context.getQueryStringParameters();
            parentRecordId = queryString._CreateFromId;

How do I achieve the same in Unified Interface mode?

Thanks in advance.

  • Chevva Profile Picture
    95 on at
    RE: How do I get the parent id in Unified Interface mode?

    Hi,

    It appears that for webresources, the following still works in UI mode:

               var queryString = window.parent.Xrm.Page.context.getQueryStringParameters();

               parentRecordId = queryString.parentrecordid;

    This article docs.microsoft.com/.../important-changes-coming states that "Although Xrm.Page is deprecated, parent.Xrm.Page will continue to work in case of HTML web resources embedded in forms as this is the only way to access the form context from the HTML web resource."

    So, it may be (many?) years before Xrm.Page is truly deprecated for webresources. If, as MS state, "...this is the only way to access the form context" I assume they will come up with an alternative...

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How do I get the parent id in Unified Interface mode?

    Hello,

    If it's located in HTML webresource you can use 2 approaches:

    1. Pass it through URL of the webresource (build it on the fly passing Id as a part of URL using data parameter).

    2. Use window.parent.Xrm.Page.getAttribute("fieldthatreferencesparententity).getValue() in your HTML webresource.

  • Chevva Profile Picture
    95 on at
    RE: How do I get the parent id in Unified Interface mode?

    The problem is that the javascript that attempts to get the parentid is located in an HTML webresource.

  • Suggested answer
    Gilmeyer Profile Picture
    on at
    RE: How do I get the parent id in Unified Interface mode?

    Hi ,

    Xrm.Page.context.getQueryStringParameters method is deprecated in Dynamics CRM365 v9. Please use formContext.data.attributes instead.

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

    Hope it helps.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

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

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

#2
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 78 Super User 2025 Season 1

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 47

Overall leaderboard

Product updates

Dynamics 365 release plans