web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Ignore messages while importing by using SetHideValidationDialog.

(0) ShareShare
ReportReport
Posted on by 69

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.

pastedimage1582759990002v3.png

Any clues on how to hide this message?
Thank you

I have the same question (0)
  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,261 Super User 2025 Season 2 on at
    RE: Ignore messages while importing by using SetHideValidationDialog.

    If you import the Header first before the Line, you should not get that message.

  • sjen Profile Picture
    69 on at
    RE: Ignore messages while importing by using SetHideValidationDialog.

    Thank you Teddy for the suggestion but i import the header first then the lines anyway.

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,261 Super User 2025 Season 2 on at
    RE: Ignore messages while importing by using SetHideValidationDialog.

    If you don't have the lines, the message will not triggered.

    Try to debug and check if there is existing line when importing the header.

  • sjen Profile Picture
    69 on at
    RE: Ignore messages while importing by using SetHideValidationDialog.

    IF UpdateLine <> UpdateLine::Update THEN
      //IF GUIALLOWED THEN (orj code)
      IF NOT HideValidationDialog AND GUIALLOWED THEN 
        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?

    I have a condition like if the header exists it adds new lines to the sales invoice.

    I traced the code and saw that salesperson onvalidate calls update dimensions function from table 357 Document Dimension and it has nothing to do with SetHideValidationDialog. It checks for  GUIALLOWED or not. I know GUIALLOWED is not property but is there anyway i can set it false? The code below didn't work for me

    Ok := GUIALLOWED;
    Ok := FALSE;
    
    //IF GUIALLOWED THEN
    // MESSAGE('GUI ALLOWED');
     
     
    Ok	Boolean
    
    // I also tried the code below and didn't work either.
    
    
    Ok := GUIALLOWED;
    
    IF Ok = TRUE THEN
      Ok := FALSE;

    Thank you

  • sjen Profile Picture
    69 on at
    RE: Ignore messages while importing by using SetHideValidationDialog.


    HideValidationDialog := TRUE;
    
    IF UpdateLine <> UpdateLine::Update THEN
    IF NOT HideValidationDialog THEN
    IF ShippedReceived THEN BEGIN
    IF NOT CONFIRM(Text006,TRUE) THEN
    EXIT
    ELSE
    IF HideValidationDialog THEN
    EXIT
    END ELSE
    IF NOT CONFIRM(Text003,TRUE) THEN
    EXIT;

    It works like the code above my but I want to set to validation dialog from the import.

    I called from the import but it passes as "False" even though I coded like that:

    DocDimensionRec.RESET;
    DocDimensionRec.SETRANGE("Table ID",36);
    DocDimensionRec.SETRANGE("Document Type",DocDimensionRec."Document Type"::Invoice);
    IF DocDimensionRec.FINDSET THEN
    DocDimensionRec.SetHideValidationDialog(TRUE);

    Any clues on how to set hidevalidation true from the import?
    Thank you so much

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,791

#2
YUN ZHU Profile Picture

YUN ZHU 2,091 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 2,090

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans