Global var set from subform does not keep its value
greys
Member Posts: 29
Hi!
I have a form (frmHEADER. based on table HEADER) with a subform (frmLINES, based on table LINES). On the subform there's a column with a field (NUMBER). The table is used on various forms and I generally want the onvalidate of the field NUMBER to be triggered, but there's one form on which I want some parts of this onvalidate to be skipped.
So I did the following:
- I created a global boolean (BlnSkipValidation) in table LINES;
- I created a function (SetSkipValidation) in table LINES that sets this boolean to TRUE;
- I edited the Onvalidate-trigger of the field NUMBER in the table LINES to make the code depending on the value of the boolean
( IF BlnSkipValidation then EXIT);
- I added the code SetSkipValidation() to the OnOpenForm-trigger of subform frmLINES.
The problem is that the value of BlnSkipValidation is not kept... It is set to TRUE on the moment the subform opens, but when I enter a number in the field NUMBER the value of BlnSkipValidation has again been set to FALSE... I moved the call of the SetSkipValidation() function to the OnAftergetrecord of form frmLines, but that didn't help.
Am I missing something or is there a better way to achieve this?
Thanks in advance
JGreys
EDIT: I solved it by taking the code out of the onvalidate-trigger of the table and putting it in the onvalidate of the form control. That works.
I have a form (frmHEADER. based on table HEADER) with a subform (frmLINES, based on table LINES). On the subform there's a column with a field (NUMBER). The table is used on various forms and I generally want the onvalidate of the field NUMBER to be triggered, but there's one form on which I want some parts of this onvalidate to be skipped.
So I did the following:
- I created a global boolean (BlnSkipValidation) in table LINES;
- I created a function (SetSkipValidation) in table LINES that sets this boolean to TRUE;
- I edited the Onvalidate-trigger of the field NUMBER in the table LINES to make the code depending on the value of the boolean
( IF BlnSkipValidation then EXIT);
- I added the code SetSkipValidation() to the OnOpenForm-trigger of subform frmLINES.
The problem is that the value of BlnSkipValidation is not kept... It is set to TRUE on the moment the subform opens, but when I enter a number in the field NUMBER the value of BlnSkipValidation has again been set to FALSE... I moved the call of the SetSkipValidation() function to the OnAftergetrecord of form frmLines, but that didn't help.
Am I missing something or is there a better way to achieve this?
Thanks in advance
JGreys
EDIT: I solved it by taking the code out of the onvalidate-trigger of the table and putting it in the onvalidate of the form control. That works.
0
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
- 333 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