Greetings,
I am hoping someone has some input regarding the following:
When revising an existing sales order, when I change the Sell-to Customer No. after it has been entered, the following message appears:
'Do you want to change the Sell-to Customer No.' I select yes...
Then the following appears:
'Do you want to change the Bill-to Customer No.' This allows you the option of changing the Bill-to Customer No. I need that selection to be 'yes' every time...I do not want the user to say 'no' and have an incorrect customer billed. I'm hoping the preceding is not a modification that occured before my involvement.
Are there any suggestions to make sure that the Bill-to is always the same as the Sell-to in this scenario?
Thanks for any help - gad1
0
Answers
There is a function in the sales header table
which controls if the dialog box appears.
Check out the other prompts it cancels before turning if off.
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
Bill-to Customer No. - OnValidate()
TESTFIELD(Status,Status::Open);
IF (xRec."Bill-to Customer No." <> "Bill-to Customer No.") AND
(xRec."Bill-to Customer No." <> '')
THEN BEGIN
IF HideValidationDialog OR NOT GUIALLOWED THEN
Confirmed := TRUE
ELSE
//I CANCELLED THE FOLLOWING LINE
//Confirmed := CONFIRM(Text004,FALSE,FIELDCAPTION("Bill-to Customer No."));
IF Confirmed THEN BEGIN..........
After cancelling the line specified above the dialog box no longer appeared which solved my issue. Other than documenting properly are there any other areas to address? I've tested this and everything seems ok. Any input is appreciated.
Thanks and have a great day - gad1
Cancelling that line is what's needed - don't forget to add a line to set the comfirmed variable as it may not be set correctly
i.e.
Confirmed := TRUE
otherwise it will not change the bill-to
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
Bill-to Customer No. - OnValidate()
TESTFIELD(Status,Status::Open);
IF (xRec."Bill-to Customer No." <> "Bill-to Customer No.") AND
(xRec."Bill-to Customer No." <> '')
THEN BEGIN
IF HideValidationDialog OR NOT GUIALLOWED THEN
Confirmed := TRUE
ELSE
//I CANCELLED THE FOLLOWING LINE
//Confirmed := CONFIRM(Text004,FALSE,FIELDCAPTION("Bill-to Customer No."));
//I ADDED THE FOLLOWING LINE
Confirmed := TRUE;
IF Confirmed THEN BEGIN......
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html