To test a field

Hi,

I hav a form called Released Production Order. There the header part is with the table “Production Order” and the line part is with the table “Prod. Order Line”. In both the header and line part v hav field called location code. At the bottom there is a button called Function with a menu item ‘Create worksheet line’. My issue is, this menu item should execute only if the location code both at the header and line part are equal. I hav put a code at OnPush() of ‘create worksheet line’ menu item as,

IF recProdOrder.“Location Code” <> recProdOrderLine.“Location Code” THEN
ERROR(‘location code should b same’);

But this is not executing. Can anyone help me out please.

Where did you get recProdOrder and recProdOrderLine?

Have created the variables for Production Order and Prod. Order Line table.

For header, we can use Rec only and for Line, we have to get record as

recProdOrderLine.setrange(Status,Status);

recProdOrderLine.setrange(Prod. Order No.,“No.”);

If recProdOrderLine.FindFirst THen

IF “Location Code” <> recProdOrderLine.“Location Code” THEN
ERROR(‘location code should b same’);

Hey thank you so much… Its working.

Welcome

There is no such menu under function “create worksheet line” in standard database.

Have you customized that ?