22 January 2018
Interesting question! In my experience, lot of standard functionalities can be mapped to migration jobs. You just have to identify which methods needs to be executed, how and in what order.
Of course the example you have given is a complex scenario because it involves part costing elements. What you have to do is to execute same methods you see in debug console in that order (some of the methods can be omitted too). It gets tricky since you have to use values returned from previous methods in later steps.
In your case, these are the steps you have to run:
Temporary_Part_Cost_Detail_API.Generate_Default_Details - In this step, use Temporary_Part_Cost_Detail_API.Get_Next_Cost_Detail_Id to get the cost detail id.
Then you have to modify this TEMPORARY_PART_COST_DETAIL with values you want to set, like cost_source_id.
After that you can run WORK_ORDER_RETURNS_API.Return_To_Inventory to perform return to inventory transaction.
If you are not familiar with IFS technical architecture, it would be better to approach someone with experience. It would be hard to give you instructions with a written post.