Dissable message box while validating Item?

bangswit
Member Posts: 265
hi all
i have sales invoice for example Shipment date is 08/17/10
and today is 09/22/10
after I add another item in this Invoice it would be message like this
Shipment Date 08/17/10 is before Workdate 09/22/10
how do I disabled it?
because i made report to import data
there're a lot of data, and it's very annoying to click OK for these messages after i import it
does anybody know how to disabled it while i import?
thanks
i have sales invoice for example Shipment date is 08/17/10
and today is 09/22/10
after I add another item in this Invoice it would be message like this
Shipment Date 08/17/10 is before Workdate 09/22/10
how do I disabled it?
because i made report to import data
there're a lot of data, and it's very annoying to click OK for these messages after i import it
does anybody know how to disabled it while i import?
thanks
0
Answers
-
bangswit wrote:hi all
i have sales invoice for example Shipment date is 08/17/10
and today is 09/22/10
after I add another item in this Invoice it would be message like this
Shipment Date 08/17/10 is before Workdate 09/22/10
how do I disabled it?
because i made report to import data
there're a lot of data, and it's very annoying to click OK for these messages after i import it
does anybody know how to disabled it while i import?
thanks
Just debug the code and find the area.
Remember where you have to set validation in the Sales Line Table at the of importing the data.Now or Never0 -
PRELIMINARY:
What are your efforts in this?
What have you tried to do?
TECHNICAL SIDE:
The Importing Processes mimic the manual process of creating Sales Invoice.
Since you know the repro step, i.e. the condition that the message will occur, I think you could utililize the Debugger to see where it comes from.
Once you get it, you can remark the code MESSAGE(Shipment Date %1 is before Workdate %2).
Usually, it is in the field OnValidate on the table.
FUNCTIONAL SIDE:
From the message it clearly stated that the Shipment Date of the line will be created (get from the Header) is BEFORE than the WORKDATE, hence simply change your workdate to the very earliest possible date, e.g. 01/01/10.
I believe the message now will be skipped.Regards,
Andwian0 -
Andwian wrote:PRELIMINARY:
What are your efforts in this?
What have you tried to do?
TECHNICAL SIDE:
The Importing Processes mimic the manual process of creating Sales Invoice.
Since you know the repro step, i.e. the condition that the message will occur, I think you could utililize the Debugger to see where it comes from.
Once you get it, you can remark the code MESSAGE(Shipment Date %1 is before Workdate %2).
Usually, it is in the field OnValidate on the table.
FUNCTIONAL SIDE:
From the message it clearly stated that the Shipment Date of the line will be created (get from the Header) is BEFORE than the WORKDATE, hence simply change your workdate to the very earliest possible date, e.g. 01/01/10.
I believe the message now will be skipped.
yes because i think it's because i validate the item no.
but can i dissabled this message box without touching the sales line table?0 -
Andwian wrote:Why don't just change the workdate temporarily to earlier date?
It is very simple and do not need any programming.
and i dont want to change that....
we, the technical side maybe can change what they want without changing workdate they want to use0 -
If you check the code, where the messagebox is displayed, you will find out that there is condition. You can set the flag to not show the dialogs through function SetHideValidationDialog on the table before you call the OnValidate. Why to do it in a hard way when you need to just call one function? 8) :whistle:0
-
kine wrote:You can set the flag to not show the dialogs through function SetHideValidationDialog on the table before you call the OnValidate. Why to do it in a hard way when you need to just call one function?
Thank you, Kamil!Regards,
Andwian0 -
kine wrote:If you check the code, where the messagebox is displayed, you will find out that there is condition. You can set the flag to not show the dialogs through function SetHideValidationDialog on the table before you call the OnValidate. Why to do it in a hard way when you need to just call one function? 8) :whistle:
SetHideValidationDialog ?
where should i put it?
in table 37 which is that is the table i want to insert in
where can i find SetHideValidationDialog ?0 -
in sales line
i want to disabled this oneShipment Date - OnValidate() . . . . . . IF "Shipment Date" < WORKDATE THEN IF NOT HasBeenShown THEN BEGIN MESSAGE( Text014, FIELDCAPTION("Shipment Date"),"Shipment Date",WORKDATE); HasBeenShown := TRUE; END; . . . . . . . .
0 -
As you can see, there is not used the variable I mentioned, thus you have two possibilities:
1) Add own condition and function to set the flag
2) Add function to set variable HasBeenShown which is already used in condition for this statement
3) Backup the curren workdate, set the workdate back to some date, validate the field, and restore the workdate.
You didn't wrote the NAV version you are on. There are differences between the versions in this standard functionality...0 -
kine wrote:As you can see, there is not used the variable I mentioned, thus you have two possibilities:
1) Add own condition and function to set the flag
2) Add function to set variable HasBeenShown which is already used in condition for this statement
3) Backup the curren workdate, set the workdate back to some date, validate the field, and restore the workdate.
You didn't wrote the NAV version you are on. There are differences between the versions in this standard functionality...0 -
For example, yes... through some function on the table... it is one way.
Or you do not need to change the table, only your report and do something like:BackupDate := WORKDATE;
WORKDATE := ShipmentDate;
VALIDATE("Shipment Date",ShipmentDate);
WORKDATE := BackupDate;
as already suggested few times...0 -
but what i want to validate is item no
still failedBackupDate := WORKDATE; WORKDATE := ShipmentDate; . . . . SalesLine.VALIDATE(SalesLine."Shipment Date",ShipmentDate); SalesLine.VALIDATE(SalesLine."Cross-Reference No.",ItemCode); . . . . WORKDATE := BackupDate;
0 -
bangswit wrote:in sales line
i want to disabled this oneShipment Date - OnValidate() . . . . . . IF "Shipment Date" < WORKDATE THEN IF NOT HasBeenShown THEN BEGIN MESSAGE( Text014, FIELDCAPTION("Shipment Date"),"Shipment Date",WORKDATE); HasBeenShown := TRUE; END; . . . . . . . .
0 -
actually i want to item in sales line
using form..... but after it validates item no, it will automatically validate shipment date
but if i block that code in shipment date... that's what i want
hope you understand0 -
in italian version, the same code that outputs the message is like this:
IF ("Shipment Date" < WORKDATE) AND (Type <> Type::" ") THEN IF NOT (HideValidationDialog OR HasBeenShown) AND GUIALLOWED THEN BEGIN MESSAGE( Text014, FIELDCAPTION("Shipment Date"),"Shipment Date",WORKDATE); HasBeenShown := TRUE; END;
note the HideValidationDialog additional parameter.
sales line has also another function, called
SetHideValidationDialog(NewHideValidationDialog : Boolean)HideValidationDialog := NewHideValidationDialog;
we can call this function passing TRUE before performing any validation logic, in order to skip every message. Very comfortable, you can replicate the same logic.0 -
Belias wrote:in italian version, the same code that outputs the message is like this:
IF ("Shipment Date" < WORKDATE) AND (Type <> Type::" ") THEN IF NOT (HideValidationDialog OR HasBeenShown) AND GUIALLOWED THEN BEGIN MESSAGE( Text014, FIELDCAPTION("Shipment Date"),"Shipment Date",WORKDATE); HasBeenShown := TRUE; END;
note the HideValidationDialog additional parameter.
sales line has also another function, called
SetHideValidationDialog(NewHideValidationDialog : Boolean)HideValidationDialog := NewHideValidationDialog;
we can call this function passing TRUE before performing any validation logic, in order to skip every message. Very comfortable, you can replicate the same logic.
so we add this code in my report?
without edit code in table 37?
i just know in nav 3.7 doesn't have this function
and i copy it from 20090 -
Belias wrote:1. create the function sethidevalidationdialog in salesline.
2. condition the message to the hidevalidationdialog parameter
3. call the function in your report before validating the fields.
already done that
but still appear the message boxSalesLine.SetHideValidationDialog(TRUE); SalesLine.VALIDATE(SalesLine."Cross-Reference No.",ItemCode);
0 -
Belias wrote:debug it!
there may be another message somewhere else, or you missed something in coding...you know it HAVE TO work!SalesLine.SetHideValidationDialog(TRUE); SalesLine.VALIDATE(SalesLine."Cross-Reference No.",ItemCode);
becomeSalesLine.SetHideValidationDialog(TRUE); SalesLine."Cross-Reference No.":=ItemCode;
it works...
but not validated0 -
bangswit wrote:Belias wrote:debug it!
there may be another message somewhere else, or you missed something in coding...you know it HAVE TO work!SalesLine.SetHideValidationDialog(TRUE); SalesLine.VALIDATE(SalesLine."Cross-Reference No.",ItemCode);
becomeSalesLine.SetHideValidationDialog(TRUE); SalesLine."Cross-Reference No.":=ItemCode;
it works...
but not validated
but you WANT TO VALIDATE this field, isn't it?
The solution is so simple that i can't explain it more than this: use debugger, find the additional message and condition it to hidevalidationdialog variable...ok?0 -
Belias wrote:bangswit wrote:Belias wrote:debug it!
there may be another message somewhere else, or you missed something in coding...you know it HAVE TO work!SalesLine.SetHideValidationDialog(TRUE); SalesLine.VALIDATE(SalesLine."Cross-Reference No.",ItemCode);
becomeSalesLine.SetHideValidationDialog(TRUE); SalesLine."Cross-Reference No.":=ItemCode;
it works...
but not validated
but you WANT TO VALIDATE this field, isn't it?
The solution is so simple that i can't explain it more than this: use debugger, find the additional message and condition it to hidevalidationdialog variable...ok?
Ok belias... thanks a lot for your advice0 -
function SetHideValidationDialog, only like this ?
SetHideValidationDialog(NewHideValidationDialog : Boolean) HideValidationDialog := NewHideValidationDialog;
0 -
solved already
(HideValidationDialog OR HasBeenShown)
in Shipment Date On validate (Table 37)
i change the code from
IF NOT HasBeenShown THEN BEGIN
become
IF NOT (HideValidationDialog OR HasBeenShown) AND GUIALLOWED THEN BEGIN
thanks all0 -
yes, the function is made by just one line, that sets a global variable to the value you're passing in. but do you understand the code i posted or are you blindly writing the code? :-k
EDIT: well, it seems you "make it work"...0 -
Belias wrote:yes, the function is made by just one line, that sets a global variable to the value you're passing in. but do you understand the code i posted or are you blindly writing the code? :-k
EDIT: well, it seems you "make it work"...
now i understand
thanks :thumbsup: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