if boolean of a field is set to true then Editable in another field should also be true

salgoraya
Member Posts: 1
Hi, can someone please help? on Business Central AL, I am trying to set a rule, where if a Field Property Editable is set to true then another field should be set to true, if it's set to false then the other field should also be set to false.
field (Record1Boolean)
{
Editable=true
}
field (Record2Date)
{
Editable=Record2Variable
}
If Record1 = true then
Record2Variable := true
else
Record2Variable:= false.
this formula allows Record1 to be an editable boolean field. however i cant seem to keep Record2 to be editable, i need it to be if Record1 is set to true then Record2 should become an editable field.
please can anyone help. i really appreciate it
field (Record1Boolean)
{
Editable=true
}
field (Record2Date)
{
Editable=Record2Variable
}
If Record1 = true then
Record2Variable := true
else
Record2Variable:= false.
this formula allows Record1 to be an editable boolean field. however i cant seem to keep Record2 to be editable, i need it to be if Record1 is set to true then Record2 should become an editable field.
please can anyone help. i really appreciate it
0
Best Answer
-
In AL, you can use a trigger that is invoked whenever the value of Record1Boolean changes. Then within the trigger, you can update the Editable property of Record2Date based on the value of Record1Boolean.
tableextension 50100 MyTableExt extends Record2Table { trigger OnModify() var Record1Boolean@field: Boolean; Record2Date@field: Date; begin if Record1Boolean then Record2Date.Editable := true; else Record2Date.Editable := false; Modify(); end; }
Note: Make sure you replace "Record1Boolean" and "Record2Date" with the correct field names.
When you implement this logic, whenever the value of Record1Boolean is changed, the Editable property of Record2Date will automatically update accordingly.0
Answers
-
In AL, you can use a trigger that is invoked whenever the value of Record1Boolean changes. Then within the trigger, you can update the Editable property of Record2Date based on the value of Record1Boolean.
tableextension 50100 MyTableExt extends Record2Table { trigger OnModify() var Record1Boolean@field: Boolean; Record2Date@field: Date; begin if Record1Boolean then Record2Date.Editable := true; else Record2Date.Editable := false; Modify(); end; }
Note: Make sure you replace "Record1Boolean" and "Record2Date" with the correct field names.
When you implement this logic, whenever the value of Record1Boolean is changed, the Editable property of Record2Date will automatically update accordingly.0 -
[Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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