how to do this please give me any suggestions ax 2012 R3.
Is doesn't make much sense to me. Can you please start by explaining the actual business requirement? Let's talk about classes etc. later.
I wants to view the last batch cost in product receipt.
Currently we have done customization to display last cost at the item level. But on product receipt last cost specific to batch and vendor be should displayed,
Last cost price is available on the inventory transaction of the item. If item has multiple batches then consider the batch which posted last. If all the multiple batches last are posted at a time, then consider the last batch.
If this what you mean by the title "how to create inventory transactions in purchparmline when open the productreceipt form by using classes" (which sounds like a pretty different thing to me), then let's delete this thread, because the same question is already covered by your thread Update lastprice(customized field) on inventory transactions form.
Please don't create multiple threads for the same question, it won't help you and it just makes everything more complicated. It's not in your interest to make it complicated for people who might help you.