Lock/Unlock a Form using Boolean Field

IrishGiri
Member Posts: 61
I want to make a boolean field available to a subset of users to allow them to control access to a form. At the moment my cod is the following:
The problem occurs when a user blocks the form. Now I can't unblock the form. I need to make this booelan field editable - I tried putting the commented code above to solve this problem but nothing happens. Once I block the form, it can't be unblocked.
Any suggestions?
Form - OnAfterGetRecord() IF xBool = TRUE THEN BEGIN CurrForm.EDITABLE(FALSE); //TestUser; //CurrForm.xBool.EDITABLE(TRUE); END; IF xBool = FALSE THEN CurrForm.EDITABLE(TRUE);
The problem occurs when a user blocks the form. Now I can't unblock the form. I need to make this booelan field editable - I tried putting the commented code above to solve this problem but nothing happens. Once I block the form, it can't be unblocked.
Any suggestions?
0
Answers
-
Yeaps you can do this....
If you have an extra codeunit/report with you, then write a new function, pass the record variable as a parameter to this function Modify the boolean filed to true and exit. Now allow permission to only few users who will be able to execute the report/codeunit.
Hope this works for you.Diptish Naskar
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/0 -
well, maybe I should clarify...I'm not worried about permissions just yet. First, I want to be able to unblock this form, I can't even do this. How can this be so difficult to program? ](*,)0
-
Solved this by creating a menu button with 2 menu items: Block and Unblock, in addition to my earlier code. The code in the OnPush trigger of each is as follows:
xBool := TRUE; MODIFY;
and....xBool := FALSE; MODIFY;
and...IF xBool = TRUE THEN CurrForm.EDITABLE(FALSE); IF xBool = FALSE THEN CurrForm.EDITABLE(TRUE);
In addition to my earlier code in the Form - OnAfterGetRecord() trigger this works a treat!0 -
Your problem is that if you set EDITABLE = false for whole form, you cannot "disable" this property through control. As IrishGiri wrote, your solution is to use button and not checkbox to unlock the form. Buttons are working even if the form is uneditable...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions