Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
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 

Categories:
  • Ram Prakash Profile Picture
    5,166 Super User 2025 Season 1 on at
    Re: Model Driven App: Form Logic - use JS to react on content in quick view form

    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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 17

#3
Fubar Profile Picture

Fubar 11 Super User 2025 Season 1

Overall leaderboard

Featured topics