Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Model-driven app (lock form)

Posted on by 707

Hello everyone,

If I have table with relationship 1:N (Parent - Child), and I created form for the child entity, but I want to lock all the field by look up to its parent table's field, lets say in the parent has field "IsPosted". So when the parent's "IsPosted" is Yes, I want all the field in this child form to be lock, how to do that?

Can I cover this with Business Rule ? but I think business rule cannot lookup to another table, am I right to say that ?

Thanks in advance.

  • Verified answer
    empath-e CRM Profile Picture
    empath-e CRM 1,134 on at
    RE: Model-driven app (lock form)

    If you are familiar with Flows within Power Automate you should be able achieve this.

    For me I had created an Events Table (Parent) with an associated Event Attendees Table (Child) The Flow is designed so that if the Event Status = 'Event Full' this would deactivate the Event Table form fields and the Event Attendees form fields too.

    The below example will just deactivate the Child Table fields as per your request.

    (1) Create a Trigger on your Parent table setting your Filter Row to Trigger the Flow

    (2) Add the List Rows Action to retrieve the rows from the Child Table associated with the Parent Table

    (3) Finally add an Apply to each Action setting the Row ID to the Child Table Unique ID and both Status values to Inactive

    Event Attendee fields are now locked (as below) One thing you may have to do within your environment is to disable the Activate option if needed. I'm sure it is a lot easier if you can write JavaScript code as per meelamri 

     

  • empath-e CRM Profile Picture
    empath-e CRM 1,134 on at
    RE: Model-driven app (lock form)

    I'm sure this can be achieved using Workflow, albeit with a lot more effort. I have done something similar before, I'm just digging it out now to see if it will work for you too

  • ShaqAX Profile Picture
    ShaqAX 707 on at
    RE: Model-driven app (lock form)

    Can I at least show the Parent's field in my child's form ?

    and basically how to do that, if it is possible.

    Thanks,

  • Suggested answer
    meelamri Profile Picture
    meelamri 13,204 User Group Leader on at
    RE: Model-driven app (lock form)

    I'm afraid this can only be implemented with a JavaScript code

  • ShaqAX Profile Picture
    ShaqAX 707 on at
    RE: Model-driven app (lock form)

    Hi, is there any other way beside JavaScript code ?

    one with low coding ?

    Thanks

  • Suggested answer
    meelamri Profile Picture
    meelamri 13,204 User Group Leader on at
    RE: Model-driven app (lock form)

    Hi, 

    Unfortunately this can't be implemented with a Business Rule because we can't check the values of the parent table.

    It can be implemented using JavaScript code.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans