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
Answers
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.
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 and
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 xmlport
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.
Thank you
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;
I can't debug since it's an xmlport and I have to run from RTC
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 solution
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?