web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
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.

I have the same question (0)
  • Suggested answer
    Gilmeyer Profile Picture
    Microsoft Employee on at

    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.

  • Chevva Profile Picture
    95 on at

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

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    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

    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...

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 101 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 83

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans