Warning message when making an invoice

Hello!

I would need some help.

When in the invoice there is a package cost (its Sales Line No. is ‘CSOM_HU’) and in Sales Header the Package Tracking No. is blank I should send a warning message, that Package Tracking No. must be filled out.

I tried to write some code in OnValidate() trigger of No. field, but it was not good. There was no message at all. :frowning:

IF “Sales Line”.“No.” = ‘CSOM_HU’ THEN

MESSAGE(‘Package Tracking No. must be filled out’);

What code and where should I put?

Thanks a lot, Frida

At what activity this warning should pop up?

Do you want that user should not be able to Post the invoice when Package Tracking no is blank and No. is CSOM_HU’?

I believe you should use ERROR instead of message at the right field and trigger.

Thanks for answering.

Yes, I would like exactly what you wrote, except one thing. The client wants only a warning about it, and then his decision is to fill it out or not, because it can happen that he doesn’t want to write a Package Tracking No.

Can you help me what is the right field and trigger in this case?

Hi (Szia) !

"Sales Line.“no.” will be the product number not the packaging number.

Maybe you are checking the wrong field ?

gabor

Hi Frida,

U should write the following code on the On Validate trigger of “No.” field in sales line:

IF ((“Sales Line”.“No.” = ‘CSOM_HU’) AND (“Sales Header”.“Package Tracking No.” =’’)) THEN BEGIN

IF NOT CONFIRM(‘Package Tracking no. is not filled, Do you want to continue’,FALSE) THEN EXIT;

END;

Hi ,

Just to clarify the problem was , that she had been using a global variable not the actual record. Which is not shown here.

Anyways

this was the code that had worked :

F ((“No.” = ‘CSOM_HU’) AND (SalesHeader.“Package Tracking No.” =’’)) THEN BEGIN
IF NOT CONFIRM(‘Package Tracking no. is not filled, Do you want to continue’,FALSE) THEN EXIT;
END;

But Amol had this right !

regards,

Gabor

Thanks Gabor

Thanks both of you for helping me.