How to set Boolean values to True
gadzilla1
Member Posts: 316
Hello all,
I've created three Boolean fields in the Customer table. These fields are represented by checkboxes on the Customer Card.
I've set the InitValue to Yes in each field which checks the checkbox for each new Customer I enter.
For each existing (old) Customer I'd like these boxes to be checked as well. Our customer service people will then uncheck as needed depending on the customer specs.
How do I get all the existing Customers 'checked' at once for these Boolean fields?
Thx - gad1
I've created three Boolean fields in the Customer table. These fields are represented by checkboxes on the Customer Card.
I've set the InitValue to Yes in each field which checks the checkbox for each new Customer I enter.
For each existing (old) Customer I'd like these boxes to be checked as well. Our customer service people will then uncheck as needed depending on the customer specs.
How do I get all the existing Customers 'checked' at once for these Boolean fields?
Thx - gad1
0
Answers
-
Hi,
I'd suggest to create a processing only report on the Customer table, in the OnAfterGetRecord trigger of the Customer Data Item
Boolean1 := 1;
Boolean2 := 1;
Boolean3 := 1;
MODIFY;
Hope this helps
0 -
Create a form on the table and put some fields on it.
In the OnOpenForm-trigger, put:MODIFYALL("Boolean 1",TRUE); MODIFYALL("Boolean 2",TRUE); MODIFYALL("Boolean 3",TRUE);
BE VERY CAREFULL IF YOU USE THIS WAY FOR OTHER THINGS. YOU CAN EASILY DESTROY YOUR DATA!Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!1 -
Thanks all!
kriki: I only plan on doing this once, and just for those fields. Are you saying that even if I do this 1x, as specified above, there is still risk?
Or rather, that rampant use of this will increase risk of data loss.
Because, if there is risk REGARDLESS, well they'll just have to use the Customer card to make changes.
0 -
The update report is really really easy to do as stated above.
Just substitute MyBooleans with your field names.
You still will have access to a reqest form where you can filter if need be.
like Blocked:No for exampleOBJECT Report 50081 OneTimeCustBoolYes { OBJECT-PROPERTIES { Date=07/25/07; Time=[ 1:26:16 PM]; Modified=Yes; Version List=; } PROPERTIES { } DATAITEMS { { PROPERTIES { DataItemTable=Table18; OnAfterGetRecord=BEGIN Customer.MyBoolean1 := TRUE; Customer.MyBoolean2 := TRUE; Customer.MyBoolean3 := TRUE; Customer.MODIFY; END; } SECTIONS { { PROPERTIES { SectionType=Body; SectionWidth=12000; SectionHeight=846; } CONTROLS { } } } } } REQUESTFORM { PROPERTIES { Width=9020; Height=3410; } CONTROLS { } } CODE { BEGIN END. } }0 -
Harry,
That's pretty cool! I ran this in test and it works great. I will run this 1x in live from object designer and then delete it.
I'm always tentative when it comes to data changes to live stuff.
Thanks everyone - Gad10 -
No problem in this case, but with "rampant use", you risk dataloss. Meaning, you just want to modify certain records and you forget to put the filter first.gadzilla1 wrote:Thanks all!
kriki: I only plan on doing this once, and just for those fields. Are you saying that even if I do this 1x, as specified above, there is still risk?
Or rather, that rampant use of this will increase risk of data loss.
Because, if there is risk REGARDLESS, well they'll just have to use the Customer card to make changes.
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Harry,
I was going through old threads and realized you had replied..thanks for that tip in your last post.
I read through the entire application designer's guide this past month. Things are really coming together. I really appreciate your help and the help of others on this site.
Take care - gad10
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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