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 :
Customer experience | Sales, Customer Insights,...
Unanswered

window.top.opener.frames[0].Xrm.Page.getAttribute("fieldname").getValue() is not working in Microsoft edge

(0) ShareShare
ReportReport
Posted on by 39

Hi,

Iam using window.top.opener.frames[0].Xrm.Page.getAttribute("fieldname").getValue(); to get the parent field value and set in child record. This code works in other browser except in microsoft edge,iam getting scrpit error...Any ideas?

I have the same question (0)
  • sardar ahmed Profile Picture
    520 on at

    Hi Victoria,

    This is an unsupported way as you're accessing the dom. You can use field mapping if there is a relationship between these two entities you're using. You can also make use of ms CRM API to get the data from parent and set it in child record.

    docs.microsoft.com/.../map-entity-fields

  • prassey Profile Picture
    39 on at

    Hi Sardar Ahmed,

    Thank you!

  • Johnny Gong Profile Picture
    6,482 Moderator on at

    Hi Victoria,

    Agree with Sardar that we'd better no manipulate the DOM directly.

    In addition, 'frames[0].Xrm.Page' is usually used to access the Xrm.Page object from IE Developer Tools console window.

    bingsoft.wordpress.com/.../

    So we can't confirm whether it runs well in Edge. Thanks.

    Regards

    Johnny

  • Madalina Toma Profile Picture
    on at

    Hello Victoria,

    Looking at your code, it is not supported, the reason behind is the fact that it uses DOM elementrs.

    Here is the documentation behind:

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/use-javascript#write-javascript-for-multiple-browsers

    "

    Because you don’t know what browser will be in use, you should make sure that any scripts that you use will work with all supported browsers. Most of the significant differences between Internet Explorer and other browser have to do with HTML and XML DOM manipulation. Because HTML DOM manipulation is not supported, if script logic is only performing supported actions and using the Client API, the changes required to support other browsers could be small.

    A cross-browser library like jQuery is a good solution for developing web resources but should not be necessary for form scripts or ribbon commands. More information: Avoid using jQuery for form scripts

    "

    The document above is applicable for both online and on premises environments.

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/supported-extensions

    Also we have the document above where you can find this part:

    "Directly accessing the Document Object Model (DOM) of any Dynamics 365 Customer Engagement (on-premises) application pages is not supported. The use of jQuery in form scripts and commands is not recommended. More information: Client scripting in Customer Engagement (on-premises) using JavaScript"

    Both documents apply for online organizations as well.

    Here's the document confirming the window.top is part of the DOM:

    https://msdn.microsoft.com/en-us/ie/hh772148(v=vs.94)

     

    https://msdn.microsoft.com/en-us/ie/hh772384(v=vs.94)

     

    Inside the document above you will find the window object having the following description:

    window

    Represents an open window.

    Other than this, looking at the code, Xrm.Page is deprecated since about 2 years ago:

    https://docs.microsoft.com/en-us/power-platform/important-changes-coming#some-client-apis-are-deprecated

    My recommendation is to use formContext.getAttribute(arg).getValue(); based on the document below and to skip the entire set of DOM elements in the beginning of the request:

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/attributes/getvalue#syntax

    I hope this 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

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans