Quantcast
Viewing all articles
Browse latest Browse all 73760

Understanding "writeOriginOwnerRelationship"

Hi,

please help me to understand the code of the method writeOriginOwnerRelationship in the InventTransOrigin*-Tables like InventTransOriginSalesLine. In general it is clear to me, that the method gets called from SalesLineType.insert to create the relation between the InventTransOrigin and InventTransOrigin*.

What is not clear to me is the use of try/catch in that method!

We've seen that the InventTransOriginSalesLine-Table is system wide and it doesn't get deleted when we drop and recreate a company. So most of the time the catch in the above statement gets called because there is some old data which needs to be updated.

Question 1: Is there any reason why the original developer does not first check if the record is there, and then do the update instead of using try and catch?

Question 2: Do you think the code is correct in the "update" - case and works at any time?

Question 3: Why is there no delete action to delete the Origin-Records? Is it because of historical data?

I'm asking this, because we seem to have some InventTrans-Records without InventTransOrigin*-Records in irregular times with our unit tests.

Kind regards

Andi


Viewing all articles
Browse latest Browse all 73760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>