Create dynamics NAV error message when sales amount is 0

Hi everyone , I'm relatively new to NAVISION world , I have a question i will be very grateful if someone can help me.

I have to create an error message that block a user when he tries to validate an sales invoice with 0 amount.

I'm sure I will be use an IF with Error msg like this :

SalesHeader.SetRange("No.", "Document No")

SalesHeader.Find('-')

If SalesHeader.Amount=0

then begin

Error('The Amount of the relate order "No.":=' +SalesHeader."No."+' cannot be 0.')

but I don't know where I will put that is on a code unit or on the order page ?

thanks for your help.

Kind regards

Answers

  • angelreynosogangelreynosog Posts: 4Member
    Hello, In the trigger of the validation of the sales invoice, put this code to see if it works ... I hope so.

    IF "Amount Including VAT" = 0 THEN
    BEGIN
    ERROR('Error Message Text');
    END
    ELSE BEGIN
    EXIT;
    END;


Sign In or Register to comment.