How to validate Over delivery,Under delivery while posting Sales order packing slip(AX2009)

I have a requirement, while posting packing slip in sales order(in SalesEditLines form)…

when a user clicks a button (customized which is used only for validating the lines for Overdelivery,Under delivery) .

can anyone please guide me how can i achieve this…