How to disable gui messages?

sjen
Member Posts: 53
Hello,
How can I disable GUI messages during import?
I am working on Nav 2009 R2 and created an xml port to import sales invoices and during import, I get a message it says You may have changed a dimension. Do you want to update the lines? I do not wish to see this message.
I traced the code and saw that salesperson onvalidate calls update dimensions function from table 357 Document Dimension. 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
so I changed the source code in table 357 document dimension, added sethidevalidationdialog but still no luck,
How can I disable GUI messages during import?
I am working on Nav 2009 R2 and created an xml port to import sales invoices and during import, I get a message it says You may have changed a dimension. Do you want to update the lines? I do not wish to see this message.
I traced the code and saw that salesperson onvalidate calls update dimensions function from table 357 Document Dimension. 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;
so I changed the source code in table 357 document dimension, added sethidevalidationdialog but still no luck,
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?
0
Best Answers
-
Hard to analyze without having the running code in front of me:
Is there any chance you have a Local AND a Global Variable named "HideValidationDialog"
So that you would set the local one in your SetHideValidateionDialog-Function and use the global one in the main Code (which would be false either way).
Weird one, but that would explain the behaviour you encounter.Austrian NAV/BC Dev5 -
We're only seeing a tiny bit of your code, so it's anyone's guess what is happening. I would suggest to debug the process and set a watch on that variable to see when it changes.5
Answers
-
Sounds to me like you can just comment out (or remove) the confirmation message altogether1
-
I tried that and I know it works but I don't want to change the source code, I only want to disable it for my import.
Maybe I should do something after END ELSE statement?
Thank you for your answer Daniel!0 -
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 much0 -
you need to define the condition under which the dialog is displayed and program it that way. If you never want to see the dialog, then there is never a condition under which the dialog is displayed, so what's the point in having the dialog there at all?
The way you've got that code, you are setting HideValidation only for the first record.1 -
yes, I never want to display that dialog when I use my import but the problem is that dialog is in table 357 Document Dimension, that's why I added a new condition to the table.
ELSE
IF HideValidationDialog THEN
EXIT
I also added repeat and UNTIL DocDimensionRec.NEXT = 0; to get all records, but still, it takes HideValidationDialog as false instead of true.
Thank you so much Daniel for you help!
0 -
Hard to analyze without having the running code in front of me:
Is there any chance you have a Local AND a Global Variable named "HideValidationDialog"
So that you would set the local one in your SetHideValidateionDialog-Function and use the global one in the main Code (which would be false either way).
Weird one, but that would explain the behaviour you encounter.Austrian NAV/BC Dev5 -
We're only seeing a tiny bit of your code, so it's anyone's guess what is happening. I would suggest to debug the process and set a watch on that variable to see when it changes.5
-
Hard to analyze without having the running code in front of me:
Is there any chance you have a Local AND a Global Variable named "HideValidationDialog"
So that you would set the local one in your SetHideValidateionDialog-Function and use the global one in the main Code (which would be false either way).
Weird one, but that would explain the behaviour you encounter.
I know I have done that once before
I checked but there is only one HideValidationDialog and that's a global variable.SetHideValidationDialog(NewHideValidationDialog : Boolean) HideValidationDialog := NewHideValidationDialog;
Thank you
0 -
We're only seeing a tiny bit of your code, so it's anyone's guess what is happening. I would suggest to debug the process and set a watch on that variable to see when it changes.
You are right Daniel, I am not very clear here.
I am running NAV 2009R2 and using XMLport from RTC 2009R2 so I can't use the debugger but I created a form and put my code there and it returns HideValidationDialog to yes.
I will look at it more.
Thank you so much for your help and time.
0 -
Maybe you can test on the Property "CurrFieldNo" ==>
HideValidationDialog = ( rec."CurrFieldNo" = 0);
//If user input => it will be <> 0 otherwise = 00
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