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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Can’t access the XRM object inside the Web Resource

(0) ShareShare
ReportReport
Posted on by

Hi

 

Can’t access the XRM object inside the Web Resource, the Scenario I am in is, on an Entity Form, I have embedded a html web resource A  as IFrame, and after some process ton hat A web resource open another html web resource B.

 

On a web resource A, I can access the form attributes via ,

 

window.parent.Xrm.Page.getAttribute("Field1").setValue("ABC");

 

but on web resource B, I cannot access the attribute.

 

window.parent.Xrm.Page is always null.

 

Is there a way around to access a CRM Form attribute on a Web resource ?

 

I am currently using CRM 2016 on premises.

 

Thank you.

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    I would like to add :

    The First Web Resource is attached with Form as an IFrame but the 2nd web Resource being open as a dialog window.

    I can get the object of window.parent.Xrm.Page but when I try get the value of an attribute it always return null.

    can someone advise or put me in a right direction.

    thank you.

  • Suggested answer
    Dynamics_Alok Profile Picture
    1,746 on at

    You can pass Attributes(parameters) from webpage A to webpage B  and use it on Page B.There are many way to do this .

    Ref :stackoverflow.com/.../transfer-data-from-one-html-file-to-another

  • Suggested answer
    ScottDurow Profile Picture
    23 on at

    If you are opening a modal dialog, then you will not be able to access the parent Xrm context - you will need to pass the values in and then when the dialog is closed, update based on the result.

    If you are opening a non-modal dialog then you can use window.opener

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Guys 

    Thanks for the replies, the scenario I am in, I needed to update a filed value on CRM Form from a web resource which opened in a dialog. 

    Scott, Thanks for confirming  "you will not be able to access the parent Xrm context from modal dialog".  or i would still be looking to achieve this.

    I have now achieved the work i was doing by using codeplex alert.js.

    Thanks again.

  • Community Member Profile Picture
    on at

    Getting CRM context in IE 11 is not working, I am able to get the context in Chrome and other version of IE, but in IE 11 I am always getting window.form as null.  How to get XRM object in IE  11? 

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans