global variable
 
            
                
                    redStripe                
                
                    Member Posts: 83                
            
                        
            
                    Hello,
I got a problem with global boolean variable, wich I defined on a table.
I set the variable in an onValidate-Trigger to true and after that I want
to check the value of the variable in the onModify Trigger. There is the
value always false, even the value in the onValidate Trigger is true.
It seems that Navision don't save the value. Is that normal or do I
something wrong?
Thanks in advance.
Regards,
RedStripe
                I got a problem with global boolean variable, wich I defined on a table.
I set the variable in an onValidate-Trigger to true and after that I want
to check the value of the variable in the onModify Trigger. There is the
value always false, even the value in the onValidate Trigger is true.
It seems that Navision don't save the value. Is that normal or do I
something wrong?
Thanks in advance.
Regards,
RedStripe
0                
            Comments
- 
            Hi
 As soon as you quit the trigger the globals have gone.
 However, if for example you set the var in a OnValidate-Trigger and this trigger calls the OnModify-Trigger, then it works.
 If you need more persistent globals, you could set/get vars in a single instance code unit or if it is only for a table status you could use a table field for that.
 Hope this helps
 Thomas0
- 
            sure?
 I think the globals are saved as long as your instance exists.
 redstripe: where or in what case do you use this? (code example)0
- 
            And main thing is, that the MODIFY and VALIDATE must be called from same Record Variable...0
- 
            redStripe,
 are you sure you really need it? If what you actually want is to to tell OnModify that "field X has been changed", you can just check it from OnModify via IF rec.Something <> xRec.Something THEN0
- 
            Variables are created in a certain context. A global variable is only global inside the scope of the object that you're working with. If you set a global variable to TRUE in ItemOne, that value will not be accessible in ItemTwo.0
- 
            Thanks for all answers.
 I solved it with this:IF rec.Something <> xRec.Something THEN 
 Regards.
 R.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
- 322 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




