Creating transaction for custom items

Hi Guys,

I have customized field on the SalesQuotationLine where called “Replacement Item”. When an item in this field is selected, the line is updated with some data.

The problem is that the customer wants also change “Lot Id” when the “Replacement item” is modified. It means to create a new transaction based on the on that item.

I have tried to trace what happens after saving new record from task (ctrl+s) to InventTrans.insert(), but i haven’t been able to reproduce the process (creating the transaction and getting the transId)…

Could anybody tell how which approach should be appropriet and which methods I should use (change) to get new lot id?