MESSAGE window for Sales Order

gadzilla1gadzilla1 Member Posts: 316
Hello all,

I have a simple question for a Sales Order issue:

I need to compare the 'Payment Terms Code' on the Invoicing tab with the 'No.' field value on the subform below.

If Type on the subform is = Resource and No. <> Payment Terms Code, the message box should display, telling the user the values are not equal.

What is the best way to do this? I want to make sure this is done in the correct location.

Thanks for any help it is much appreciated - gad1

Answers

  • Alex_ChowAlex_Chow Member Posts: 5,063
    Put the code on the "No." field on the OnValidate trigger in the Table designer.
  • gadzilla1gadzilla1 Member Posts: 316
    Thanks Alex,

    I'm on track there for Sales Line table location for the code - thank you.

    However, what is the correct way to compare the two values mentioned, one on the Invoicing tab of the Sales Order (form) and the value of No. (subform).

    It's not firing the message box correctly for me (not at all) - I must be missing something in my code syntax. How do you do this? Thanks - gad1
  • SavatageSavatage Member Posts: 7,142
    on the sales line table go to the "No." field & click to see the cal code.
    you should be on the "No." -Onvalidate() trigger

    If you scroll down near the bottom of this trigger you should see something like this..

    Type::Resource:
    BEGIN
    Res.GET("No.");
    Res.TESTFIELD(Blocked,FALSE);
    Res.TESTFIELD("Gen. Prod. Posting Group");
    Description := Res.Name;
    VALIDATE("Unit of Measure Code",Res."Unit of Measure Code");
    "Unit Cost ($)" := Res."Unit Cost";
    "Gen. Prod. Posting Group" := Res."Gen. Prod. Posting Group";
    "Tax Prod. Posting Group" := Res."Tax Prod. Posting Group";
    "Tax Group Code" := Res."Tax Group Code";
    "Allow Item Charge Assignment" := FALSE;

    //Add you code to the end
    IF SalesHeader."Payment Terms Code" <> "No." THEN
    MESSAGE ('Incorrect Code - doesn't match header!!');

    //Don't forget to add a little comment about what the change is for!!!
  • gadzilla1gadzilla1 Member Posts: 316
    Thanks Harry/everyone else,

    I made a small error and this resolved it.

    Have a great day - gad1
  • SavatageSavatage Member Posts: 7,142
Sign In or Register to comment.