web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Understanding "writeOriginOwnerRelationship"

(0) ShareShare
ReportReport
Posted on by

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

*This post is locked for comments

I have the same question (0)
  • Volker Breitkopf Profile Picture
    on at
    RE: Understanding "writeOriginOwnerRelationship"

    I'd be interested in that, too. Anyone?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans