Packing Slip in AX2012

Dear All,

I pass one General journal at the time of PO is packing slip.where i write the code i tried in purchformletter_packingslip.but it fires only when the form is open.i want pass the journal when press OK button.

could you please help me any body…

Thanks Advance.