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 / Lock Main Form and Sub...
Power Apps
Unanswered

Lock Main Form and Sub grids

(0) ShareShare
ReportReport
Posted on by 173
I have a main form and two sub grids on the model driven app. What i want to do is that when a request is in certain status as shown below, I want to either lock or dont lock depending on which role the user is associated with. 
 
How can i achieve this?
 
 Status Lock fields on Main Form and 2 sub grids for general user Lock fields on Main Form and 2 sub grids for AM user Lock fields on Main Form and 2 sub grids for Admin User
Draft No Lock No Lock No Lock
Draft Update No Lock No Lock No Lock
In Review Lock No Lock No Lock
With Tax Approver Lock Lock No Lock
With BU and CC Approvers Lock Lock No Lock
With Director Lock Lock No Lock
With General Manager Lock Lock No Lock
With BusinessOp Lock Lock No Lock
With CEO Lock Lock No Lock
With Scrap Approver Lock Lock No Lock
With Asset Accounting Processor Lock No Lock No Lock
With Asset Accounting Sign Off Lock No Lock No Lock
Complete Lock Lock No Lock
Void Lock Lock No Lock
Rejected Lock Lock No Lock
Categories:
I have the same question (0)
  • Vejai SH Profile Picture
    560 on at
     
    Using Javascript you can achieve this 
     
    1. Declare the array to hold the status (only lock) for general user and AM User,
    Like: var arrGeneralUser=["In Review","With Tax Approver","With BU and CC Approvers",........]
             var arrAMUser=[],"With Tax Approver","With BU and CC Approvers",........]
     
    2. To get the user role, you can follow 
     
    3.  Based on Role and Status you have should choose the array to find the value  
    4. If Value found, then lock
     To lock, you can follow
     
     
    Thanks,
    Vejai SH
     
    Please mark as answer if my suggestion helps you.
     
  • ctrl_kudorje Profile Picture
    173 on at
    @Vejai SH - I was able to lock the main form fields, but now I also need to lock a sub - grid. Any ideas on how to achieve this? The two factors to lock sub grid is based on same table above.
  • Vejai SH Profile Picture
    560 on at

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 493 Most Valuable Professional

#2
11manish Profile Picture

11manish 479

#3
Haque Profile Picture

Haque 328

Last 30 days Overall leaderboard