cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Inpriya01
Level: Powered On

model driven app lock record for editing

Hello team

 

we have a custom entity in CDS, and we have developed a model driven app on top of it.

is there any way to lock a record for editing if status=Inactive.

i know we can restrict editing certain fields using business rules in entity but we want to block whole record from editing.

 

is it possible?

4 REPLIES 4
Highlighted
DavidJennaway
Level: Powered On

Re: model driven app lock record for editing

By default an inactive record (based on the statecode attribute) should be read-only in a model-driven app form. Are you seeing different behaviour ?

Inpriya01
Level: Powered On

Re: model driven app lock record for editing

Hi David
Thank you for your reply..
Basically the requirement is as follows:
1.Requester create a new record in customer entity using mode driven app
2. On creation of new record, a flow is triggered for approval. Until approver take action on this record, the approval status field will be marked as ‘pending for approval’
3. Until the request is approved or rejected, only requester and Approvers should have access to change the field values of this record. Record must be locked for other users to access

Is it possible to achieve this in entity model driven app?
DavidJennaway
Level: Powered On

Re: model driven app lock record for editing

You can achieve this in a model-driven app, though you may need a bit of javascript code. You can use a business rule to make fields read-only based on a status, and this needs no code, but if you want to make this logic conditional on whether the user is the approver or requester, then you'll need some javascript

Inpriya01
Level: Powered On

Re: model driven app lock record for editing

thanks for our reply David.

I see a field called "owner". an owner can be a single user or a team.

I am not sure if this field can control the data editing?

whoever is the owner of the record only he can edit the data??

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Users Online
Currently online: 315 members 4,449 guests
Please welcome our newest community members: