Advance Payment against Sales

advance payment against each sale transaction and wants a control in Ax so that before generating delivery challan/packing slip in Ax, sales department with consultation of Accounts department will tag advance payment voucher received from customer so that advance amount is settled in the invoice itself and Ax should allow generating Delivery and invoicing after the attachment of Advance payment else user can not generate the DC and invoice from the Ax.
I Taken ENum Type In EDT called CheckMarkup field in CustTransOpen
and i Placed it in CustopenTrans form
please Suggest me the code I tierd no.of times the code but it is not working , please suggest the code