Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Lock existing records based on condition from a different Entity

(0) ShareShare
ReportReport
Posted on by 50

Hello, 

I have an entity called   "Exam" and within this entity I have a look up field called "Exam Number".  This look up field "Exam Number" Entity has  the following fields

  • Exam Number
  • Exam Start Date
  • Exam End Date 

Once the teacher enters "Exam End Date" on this Form (Entity); it should lock the entire "Exam" Form (Entity). There can be multiple existing Exam Records with same Exam Number. So this feature should lock multiple records when teacher enters Exam End Date.  

Can this be done without Java script? If not, please also help me out with the code. 

  • Suggested answer
    Henry J. Profile Picture
    Henry J. 5,237 on at
    RE: Lock existing records based on condition from a different Entity

    Hi Emanuel,

    Have you also explored using Calculated Fields and Business Rules?

    For example, an "Exam End Date" date calculated field on the "Exam" entity could be equal to the related "Exam Number"'s "Exam End Date".

    Then have Business Rules that locks the "Exam" fiels in case "Exam End Date" contains data.

    Henry

  • Suggested answer
    RE: Lock existing records based on condition from a different Entity

    Hello,

    So in order to achieve what you want you can use either a plugin or a flow.

    In both scenarios the logic would be similar, you trigger your process on the update of the ExamNumber when the End Date is populated. Then you query all Exams that have the lookup field to the ExamNumber where the process triggered, and change the status of all these Exams to Inactive.

    You can use this flow as an example of the logic. Keep in mind that this flow is just a sample and does not currently work, but you can use it as a base to build your own.

    pastedimage1603969183662v1.pngpastedimage1603969280534v2.png

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,540 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans