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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

parent.Xrm Deprecation in version 9

(0) ShareShare
ReportReport
Posted on by 700

Hi,

We have created custom html page, in that we used parent.Xrm till now is it working but as per Microsoft parent.Xrm is deprecated in version 9. So what is the alternative for this.

Thanks!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Can you please provide urls where:

    1. Microsoft mentioned that parent.Xrm is supported construction before 9.0.

    2. Anouncement of deprecation in v9.0

  • Balasaheb Profile Picture
    700 on at

    Hi Andrew,

    Below is the link where Microsoft metioned about it.

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

    Thanks!

    Balasaheb

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

    Thanks,

    What's your scenario? What do you want to access? Xrm.Page or Xrm.Utility?

  • Balasaheb Profile Picture
    700 on at

    Hi,

    We want to acess both Xrm.Page and Xrm.Utility. but we can skip Xrm.Utility because  have option in above mentioned url.

    We want client url and userid, user language etc.

    Thanks!

  • Suggested answer
    Tomas Prokop Profile Picture
    590 on at

    Hi, there is an update for this in docs:

    Use of the Xrm.Page object as a static access to the primary form context is still supported to maintain backward compatibility with the existing scripts. Based on the feedback, we understand that the usage of Xrm.Page is high, and it won’t be removed as soon as some other client API methods listed in this section. We encourage you to use the new way of getting form content where possible.

    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.

  • Suggested answer
    Pawar Pravin  Profile Picture
    5,237 on at

    Hi ,

    Can you please debug and check once ?
    I'm using it for v9.0 only and its working fine for me as well.

    ex.

    var lookupItem = parent.Xrm.Page.getAttribute("contact").getValue();

    7433.a.JPG

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    As per Microsoft website, CRM V9 will support Xrm.Page. But It will be removed in the future.

    The alternative API is "ExecutionContext.getFormContext"

     

    Steps: 

    1. Click on "Pass Execution context as first parameter" in the Event Handker properties 

    (see image below)

    2. Then get the Execution context as a function parameter

    eg:  function SampleFunction(executionContext){

    3. Create formContext variable

    var formContext = executionContext.getFormContext();

    4. Replace Xrm.Page with formContext

    // var asset=Xrm.Page.getAttribute("sample_asset");

    var asset = formContext.getAttribute("sample_asset");

     

    Pass-Execution-Context.PNG

     

  • Suggested answer
    Community Member Profile Picture
    on at

    Microsoft will publish an alternative at the time of removal. As of now we are still good to use Xrm.Page

  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi everyone,

    Microsoft have published a replacement Client API called getFormContext and information on it is available here. Xrm.Page will continue to be available and supported until its official removal in a future major release of Dynamics 365.

  • Zhenyu Wang Profile Picture
    on at

    So, what is the replacement of parent.Xrm.Page?

    I don't think parent.ExecutionContextObj.getFormContext() has value.

    Maybe there is another methold?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans