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

Read parent window's values in a child window

(0) ShareShare
ReportReport
Posted on by 25

How can I read parent window's fields and pass it to a web resource in a child window (Modal)?

Something like below,

pastedimage1587136344880v1.png

I need to read about 10 fields and use it in web resource.

I can retrieve with a service call, but just checking if i can read directly using getAttribute.

Tried few methods like this - window.opener.parent.Xrm.Page.getAttribute("myfield").getValue()

Thanks in advance.

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

    Hello,

    I would highly recommend to use WebApi to get the data. If you anyway want to get the data using DOM you should try to use window.parent.Xrm... to get the data.

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

    Hello,

    If my reply answered your question take a minute and verify my reply as an answer by clicking "Yes" under message "Does this answer your question?".

  • Sudharshini Profile Picture
    25 on at

    @Andrew, Any thoughts on how to refresh the parent form through javascript while closing the modal dialog?

  • Verified answer
    Marco.P Profile Picture
    2,405 on at

    Can't you just add Xrm.Page.data.refresh(); on callback of the Xrm.Navigation.navigateTo function?

    Something like this:

    Xrm.Navigation.navigateTo(INPUT).then(

       function success() {

               Xrm.Page.data.refresh();

       },

       function error() {

               // Handle errors

       }

    );

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

    Hello,

    There are few ways on how you can do that:

    docs.microsoft.com/.../refresh

    docs.microsoft.com/.../openform

  • Sudharshini Profile Picture
    25 on at

    Thanks, this worked.

  • Sudharshini Profile Picture
    25 on at

    How do we pass the return value from webresource to success callback?

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

    The only easy way of doing it I found was usage of sesionStorage/localStorage. If you want to see the way I do it - I have a post/video scheduled for this week where I will demonstrate how I do it. So if you don't want to miss it - subscribe to my blog and youtube channel.

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 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 61

#3
Gerardo Rentería García Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans