<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Is there an easy way to run code after a change/creation transaction finished?</title><link>https://www.aras.com/community/f/development/55295/is-there-an-easy-way-to-run-code-after-a-change-creation-transaction-finished</link><description>Hello, 
 I need to send a created/ changed item to another service. I have some code that just needs the ID of an Item, it then retrieves it from the database and sends it to the other service. 
 The problem I am facing is that, I can&amp;#39;t find a way to</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Is there an easy way to run code after a change/creation transaction finished?</title><link>https://www.aras.com/community/thread/10498?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 09:39:39 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:4417114e-34c7-4fe7-82e4-7a86e5947692</guid><dc:creator>Fflur</dc:creator><description>&lt;p&gt;Small update, I found the function &amp;quot;CCO.DB.InnDatabase.CommitTransaction();&amp;quot; and if I call this before MyFunction everything works like I expected. Is this fine or is there a better way to do this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there an easy way to run code after a change/creation transaction finished?</title><link>https://www.aras.com/community/thread/10497?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 09:11:44 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:e251b70b-198c-4946-ac04-a62897922fb2</guid><dc:creator>Fflur</dc:creator><description>&lt;p&gt;Hi Eli, thanks for the quick&amp;nbsp;reply!&lt;br /&gt;&lt;br /&gt;- When I pressed save or done on an Item I used to get a null error message, (now I dont&amp;nbsp;see any error&amp;nbsp;in Aras but the save still fails/ gets aborted)&lt;/p&gt;
&lt;p&gt;- I&amp;#39;m not&amp;nbsp;quite sure what that means, but when I save an item, a versioning attribute is incremented and&amp;nbsp;I&amp;nbsp;can also create new revisions of the item&lt;/p&gt;
&lt;p&gt;- My Code:&lt;br /&gt;&amp;nbsp; &amp;nbsp; var id = this.getID();&lt;br /&gt;&amp;nbsp; &amp;nbsp; var type = this.getType();&lt;br /&gt;&amp;nbsp; &amp;nbsp; MyDll.MyFunction(id, type);&lt;br /&gt;&amp;nbsp; &amp;nbsp; return this;&lt;/p&gt;
&lt;p&gt;The basic idea is that I get the updated id of the changed item and feed them into my custom function. Inside of MyFunction I do an async AML request against Aras &amp;lt;AML&amp;gt;&amp;lt;Item type=&amp;quot;type&amp;quot; action=&amp;quot;get&amp;quot; where=&amp;quot;[Item].id=&amp;#39;id&amp;#39;&amp;quot; /&amp;gt;&amp;lt;/AML&amp;gt; and then push the result to a different service. This works fine if I test it with a static id but if I try to use this.getID() the changed item does not get found and the AML returns null as result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there an easy way to run code after a change/creation transaction finished?</title><link>https://www.aras.com/community/thread/10492?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2024 18:38:36 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:57ec137c-70e9-4690-8d73-77b53c2dbb2c</guid><dc:creator>Eli Donahue</dc:creator><description>&lt;p&gt;Hi Flur! It sounds like the onAfterUpdate event should do the trick, though you may want to include an onAfterAdd event if you need to run your logic for newly created items as well.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have a couple questions to help troubleshoot the issue you&amp;rsquo;re seeing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What&amp;rsquo;s the error message you&amp;rsquo;re seeing?&lt;/li&gt;
&lt;li&gt;Is the context item versionable?&lt;/li&gt;
&lt;li&gt;Can you share your onAfterUpdate method code? At least the part that shows how you&amp;rsquo;re trying to get the data to send to the other system?&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>