Issue with Changing Sell-to Customer No. on SO

gadzilla1gadzilla1 Member Posts: 316
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

Answers

  • DaveTDaveT Member Posts: 1,039
    Hi gadzilla1,

    There is a function in the sales header table
    SetHideValidationDialog(NewHideValidationDialog : Boolean)
    HideValidationDialog := NewHideValidationDialog;
    

    which controls if the dialog box appears.

    Check out the other prompts it cancels before turning if off.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • gadzilla1gadzilla1 Member Posts: 316
    Thanks Dave - Here's what I did...

    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
  • DaveTDaveT Member Posts: 1,039
    Hi 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 :wink:
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • gadzilla1gadzilla1 Member Posts: 316
    Thanks! I appreciate the help. I did the following:


    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......
  • DaveTDaveT Member Posts: 1,039
    Looks good - Glad to help
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • gadzilla1gadzilla1 Member Posts: 316
    Thanks! I'll edit this item as solved.
Sign In or Register to comment.