How to allow user to only select boolean once per record?

alex6789
Member Posts: 9
How would you approach the following example...
A list page has been created where the user can create a description (e.g. blue paint) and select a series of checkboxes (i.e. gloss/matt/satin/special). For entry 1 the user has created a description and selected the checkbox 'gloss'. For the next entry, the user will create another description and should not be able to select gloss (they should only be able to select the remaining options).
A list page has been created where the user can create a description (e.g. blue paint) and select a series of checkboxes (i.e. gloss/matt/satin/special). For entry 1 the user has created a description and selected the checkbox 'gloss'. For the next entry, the user will create another description and should not be able to select gloss (they should only be able to select the remaining options).
0
Best Answers
-
hello alex,
it's simple, you should put a code in the OnValidate trigger of your checkboxes that will setrange an instance of your table with the field checked and put 'true' as value, if findfirst then put an error message else let him check that checkbox.1 -
if you put this code in the OnValidate trigger of every checkbox field that you have
if Rec.YourCheckBoxFieldName = true then begin
YourTableInstanceName.Reset()
YourTableInstanceName.setrange(YourTableInstanceName.YourCheckBoxFieldName,true)
if YourTableInstanceName.findfirst() then Error("You are not allowed to check this one because it is already checked by another user.")
end
everything will be work fine.
1
Answers
-
hello alex,
it's simple, you should put a code in the OnValidate trigger of your checkboxes that will setrange an instance of your table with the field checked and put 'true' as value, if findfirst then put an error message else let him check that checkbox.1 -
forgot to mention if the user was to untick this, they should also be allowed. how would you get around that?0
-
if you put this code in the OnValidate trigger of every checkbox field that you have
if Rec.YourCheckBoxFieldName = true then begin
YourTableInstanceName.Reset()
YourTableInstanceName.setrange(YourTableInstanceName.YourCheckBoxFieldName,true)
if YourTableInstanceName.findfirst() then Error("You are not allowed to check this one because it is already checked by another user.")
end
everything will be work fine.
1
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