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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Model Driven App: Form...
Power Apps
Unanswered

Model Driven App: Form Logic - use JS to react on content in quick view form

(0) ShareShare
ReportReport
Posted on by 254

Dear community, 

yesterday I struggles heavily by building a simple JS script. Meanwhile I'm not even sure if the idea can be implemented at all, so I hope for your suggestions. 

I have 2 entities A and B. At A there is a boolean, let's name it "isValidForX". 

There is a 1:N relation between A and B (for 1 A there can me many B). 

 

At main form of B I would like to have a field visible depending which record of A is selected, or to be more precise dependent on "isValidForX" property of selected record from A. As far as I know to have JS magic all information I would like to check for must be at the form itself. So I created a little quick view form at Entity A having this bool contained. I've added this form at main form of B. 

So far so good. If I now do any selection at B for my relation to A I can see the correct value of the isValidForX field inside the quick view form. 

But if I try to get it's value it is always null. I did it step by step so I'm sure I have the right objects identified. I'm afraid the problem is a timing issue. My script runs onLoad of main form B and probably while rendering the whole form. So I guess the execution is finished before the system read the relation to record A and as consequence the value to be displayed in the quick view form is simply not yet present. 

Any idea how to avoid this?

Are there other options in place to get the needed value? I already thought of having a fetchXML getting the data but did not tried so far. 

 

Any suggestion welcome!

Thanks in advance

Stefan 

I have the same question (0)
  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hi @SteRe 

     

    I think you are facing timing issue. you can give a try for Xrm.Page.data.refresh().

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Follow me on Twitter : @rampprakashd
    Blog : https://microsoftcrmtechie.blogspot.com

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard