Ignore messages while importing by using SetHideValidationDialog.

sjen
Member Posts: 53
Hello I am using NAV 2009R2 and I have an xmlport to import sales invoices and i would like to ignore any messages while I import.
I used SetHideValidationDialog(TRUE) right before validate lines for the sales header and for the sales line but I still get one message while I am importing. I traced the code and it has something to do with salesperson code I believe.

Any clues on how to hide this message?
Thank you
I used SetHideValidationDialog(TRUE) right before validate lines for the sales header and for the sales line but I still get one message while I am importing. I traced the code and it has something to do with salesperson code I believe.

Any clues on how to hide this message?
Thank you
0
Answers
-
Hi,
I would recomend to debug the code to indentify what tables are populating those messages and try find hide dialog functions like the one you tried to call in the tables.
SetHideValidationDialog() is not a magic function (but comes with the standard), it just sets HideValidationDialog variable to TRUE so in every CONFIRM() of the code is skipped. However, if there is custom code, you may need to change it.
Also keep in mind GUIALLOWED system function.
1 -
Hi @txeriff,
Thank you for your input.
Let me explain a little bit more. I also had another discussion here and Daniel helped me but I still couldn't find a solution.
https://forum.mibuso.com/discussion/comment/330622#Comment_330622
During my xmlport salesperson code validate code has a logic and it goes to table 357 Document Dimension andIF UpdateLine <> UpdateLine::Update THEN //IF GUIALLOWED THEN (orj code) IF NOT HideValidationDialog AND GUIALLOWED THEN // I added this line IF ShippedReceived THEN BEGIN IF NOT CONFIRM(Text006,TRUE) THEN EXIT END ELSE IF NOT CONFIRM(Text003,TRUE) THEN //this line cause a problem EXIT; Text003 You may have changed a dimension.\\Do you want to update the lines?
executes the code above. What I am trying to do is skip this part of code while I import my sales invoices but whatever I did I couldn't achieve. I don't want users to see any messages. I already have the code below before the validate fields in my xmlportsalesHeader.SetHideValidationDialog(TRUE); salesLine.SetHideValidationDialog(TRUE);
I also added DocDimensionRec.SetHideValidationDialog(TRUE); to my xmlport and I am seeing it sets SetHideValidationDialog to TRUE before import but while import it sets to false.
Is there any way you can think of I can skip that message box?
in my other post, I mentioned that I set GUIALLOWED to false in my xmlport but still during import I think it sets itself to TRUE.Ok := GUIALLOWED; Ok := FALSE;
Thank you
0 -
Hi ,
If you debug it, you would see.
the line that says "//this line cause a problem"
to the last ELSE add the following (sorry but TAB key does not work in here);
else begin
if (hidevalidationdialog=false) and (GUIALLOWED) then begin
if not confirm(Text0003,true) then
exit;
end;
end;0 -
Thank you for correcting, however during import it still displays the message. I know the code is correct now but maybe I am missing something in my xmlport?
I can't debug since it's an xmlport and I have to run from RTCIF UpdateLine <> UpdateLine::Update THEN IF NOT HideValidationDialog AND GUIALLOWED THEN IF ShippedReceived THEN BEGIN IF NOT CONFIRM(Text006,TRUE) THEN EXIT END ELSE BEGIN IF NOT HideValidationDialog AND GUIALLOWED THEN BEGIN IF NOT CONFIRM(Text003,TRUE) THEN EXIT; END; END;
0 -
Hi,
oh I see, xmlports on NAV 2009... I forgot about that..
Are you sure the message is CONFIRM(Text003) what you are getting?
i can recomend to add some traces to "debug" : Message(' pass');
you can add different messages and see them to trace what code is doing.
Try to MESSAGE(format(HideValidationDialog )) before all the IF updateline<>updateline::Update
this way you will see if hidevalidationdialog has really true value.
the other way is try convert it partially to dataport?
0 -
Hi,
oh I see, xmlports on NAV 2009... I forgot about that..
Are you sure the message is CONFIRM(Text003) what you are getting?
i can recomend to add some traces to "debug" : Message(' pass');
you can add different messages and see them to trace what code is doing.
Try to MESSAGE(format(HideValidationDialog )) before all the IF updateline<>updateline::Update
this way you will see if hidevalidationdialog has really true value.
the other way is try convert it partially to dataport?
Yes, I am sure the message is CONFIRM(Text003).
Because if I set HideValidationDialog to true in table 357 document dimension right before my mod it doesn't display the message during my import, however, I don't want to set HideValidationDialog to true in that table. I should be able to set it from the xmlport.
Since HideValidationDialog is not a field I can't use MESSAGE(format(HideValidationDialog ))
I really appreciate your help! I am still trying I will find a solution0 -
I have tested it and it always set HideValidationDialog to false.
in Document Dimension table the code I am trying to set HideValidationDialog to true is a local function called UpdateAllLineDim. Is it because of a local function that's why it never changes the value?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