{
    "header": {
        "version": 1,
        "type": "record"
    },
    "body": {
        "record1": {
            "<1>": "declare function rowexists, fieldcount, msg\r\n$insert logical\r\n$insert msg_equates\r\n\r\n\r\nLineErr = false$\r\nInvDetail = .inv_detail->array\r\nMostRows = 0\r\nfor i = 1 to 10 \r\n   Tcnt = fieldcount( InvDetail<i>, @vm )\r\n   if Tcnt > MostRows then\r\n      MostRows = Tcnt\r\n   end\r\nnext i\r\nfor i = 1 to MostRows\r\n   OrdNo = InvDetail<1,i>\r\n   Tvar  = InvDetail<2,i>\r\n   Tvar := InvDetail<3,i>\r\n   Tvar := InvDetail<4,i>\r\n   Tvar := InvDetail<5,i>\r\n   Tvar := InvDetail<6,i>\r\n   Tvar := InvDetail<7,i>\r\n   Tvar := InvDetail<8,i>\r\n   Tvar := InvDetail<9,i>\r\n   Tvar := InvDetail<10,i> \r\n   if ( OrdNo = '' ) and ( Tvar = '' ) then\r\n       * BLANK LINE\r\n   end else\r\n\t   if ( OrdNo = '' ) and ( Tvar <> '' ) then\r\n\t      * FORCE THEM TO HAVE AN ORDER NUMBER CAUSE THIS IS USED IN\r\n\t      * THE INVENTORY UPDATING MODULES FROM ORDER AND INVOICE TO DETERMINE\r\n\t      * HOW MANY LINES\r\n\t      MsgInfo = ''\r\n\t      MsgInfo<mtext$> = 'Row ':i:' must have an order number.'       \r\n\t      MsgInfo<micon$> = '!'\r\n\t      Void = msg( '', MsgInfo )\r\n\t      LineErr = true$\r\n\t   end\r\n   end\r\nnext i\r\nif LineErr then\r\n    return 0\r\nend else\r\n\tif rowexists( 'WAFER_INV', .waf_inv_no->text ) else\r\n\t   .entry_id->text = @user4\r\n\tend\r\n\treturn 1\r\nend"
        }
    }
}