cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Responsive Resident
Responsive Resident

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 ?

Highlighted
Frequent Visitor

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?
Highlighted
Responsive Resident
Responsive Resident

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

Highlighted
Frequent Visitor

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Users online (7,624)