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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / CDS / Model-Driven: lo...
Power Apps
Answered

CDS / Model-Driven: lock registration after use or approval

(0) ShareShare
ReportReport
Posted on by 175

Hello guys!

 

I have difficulty using the CDS / Model-Driven

 

I would like to know how to lock (not allow editing) some records after they are used in other tables, or after their approval.

In this example, I have two tables "Tema" and "Demanda", I would like that once a "Tema" is used in the "Demanda" table it will no longer be editable. In the same way, in case the "Demanda" is approved (idSituacaoDemanda = 3) it would also not be editable anymore, otherwise the user could edit the record.

galdezanni_0-1615389892236.png

 

I tried to use the rollup, but I found some difficulties and limitations of use - I was unable to apply the condition "IF (Tema.idTema in Demanda.idTema)" - and the calculation update time (the calculation is not instantaneous).

 

Would there be any outside of applying these elements without the use of rollup, or how to perform the rollup properly?

 

Thanks!

  • Verified answer
    ChrisPiasecki Profile Picture
    6,428 Most Valuable Professional on at

    Hi @galdezanni,

     

    There are a few ways to achieve this, including:

    1. Use a boolean column to indicate whether it's locked/completed, using field level security to restrict access to modify the field. Use a business rule and real-time workflow to lock fields and cancel saving of the record when this flag is set; OR
    2. Reassign the record to a different user/team in a different business unit so that only they can modify the record ; OR
    3. Deactivate the record, and use a real time workflow to prevent reactivating the record unless the user is in a certain team or some other condition of your choosing. 

     

    I'm not sure what your specific meaning is around I would like that once a "Tema" is used in the "Demanda" . If it simply means that at least one child record is associated with the parent, then you could trigger a real time workflow on creation of a "demanda" or update (upon changing the temaid value), and then use that to lock down the related "Tema" using one of the methods mentioned above.

     

    Finally, if you want to use a total count of "demanda" records as your method of locking, you are correct that you can't use a rollup field because its not real-time. Instead you can increment/decrement the total using real time workflows. An example of this is documented here, still relevant in today's version. 

     

    https://www.magenium.com/Information/Articles/calculating-aggregates-dynamics-crm-2013-real-time-workflows

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

  • galdezanni Profile Picture
    175 on at

    Thanks @ChrisPiasecki  for your response,

     

    I would need to check if, for example:

    idTema = 5 appears in the column of the Demanda.idTema table; Tema.idTema = 5 would be locked for editing, otherwise it can still be edited.

     

    I tried to do it with business rules and processes, but I couldn't make this comparison between the two tables (Tema.idTema [5] in Demanda.idTema)

     

    Would there be a way to do that?

     

    Thanks!!!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard