Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Suggested answer

Ignore messages while importing by using SetHideValidationDialog.

Posted on by 55

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

  • sjen Profile Picture
    sjen 55 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

  • sjen Profile Picture
    sjen 55 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

  • Suggested answer
    TeddyH Profile Picture
    TeddyH 12,861 Moderator 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
    sjen 55 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
    TeddyH Profile Picture
    TeddyH 12,861 Moderator 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.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,647 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans