Error adding Custom Description field to BOMs and Work Order Screens

BOMs

I am trying to add a custom long description field to our Manufacturing BOM screen (BOH0) and receiving this error - 

I've added a "Before Field" Action to the ITMREF field and added this as the script. 

Subprog AV_ITMREF(VALEUR)
Variable Char VALEUR()
if clalev([F:ITM])=0 : Local File ITMMASTER[ITM] : Endif
Read[F:ITM]ITM0=VALEUR
if !fstat and VALEUR<>''
[M:BOH0]ZLONGDESC(nolign-1)=[F:ITM]ZLONGDESC : Affzo [F:BOH0]ZLONGDESC
Endif
End

I've tried tried the following to fix my issue with no success. 

Made sure to Compile the script.
Validated the Screen
Did a Global Validation on the the window.

Work Order

Anytime I try to edit Screen MFG1 regardless of what I'm changing or adding  I receive the following error - 

Any help would be greatly appreciated, thanks!

  • 0

    I assume ZLONGDEC is on the BOM header, and the description is for the parent product. If that's the case, ZLONGDESC would be a field on the header, and NOT in a table. You should not need to specify the line number. Try the following instead.

    [M:BOH0]ZLONGDESC=[F:ITM]ZLONGDESC : Affzo [F:BOH0]ZLONGDESC

  • 0 in reply to Mike Tsai

    That makes sense but my current script works fine for the product-sites screen I've added to as well. I did try your example and still received the index error Disappointed.

    if clalev([F:ITM])=0 : Local File ITMMASTER[ITM] : Endif
    Read[F:ITM]ITM0=VALEUR
    if !fstat and VALEUR<>''
    [M:BOH0]ZLONGDESC=[F:ITM]ZLONGDESC : Affzo [M:BOH0]ZLONGDESC
    Endif