<?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>Unable to increment Revision of &amp;quot;Affected Item&amp;quot; under ECN using AML code</title><link>https://www.aras.com/community/f/development/3109/unable-to-increment-revision-of-affected-item-under-ecn-using-aml-code</link><description>Hi All,

The below code is used to increment the revision of the affected item under ECN and set the new value to New Item Revision property under the &amp;quot;Affected Item&amp;quot; Itemtype. This code is working properly in Aras 9.2 but not incrementing the revision</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Unable to increment Revision of "Affected Item" under ECN using AML code</title><link>https://www.aras.com/community/thread/82?ContentTypeID=1</link><pubDate>Mon, 26 Dec 2016 01:10:55 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:872243b5-a352-436a-b2a4-08778540ec16</guid><dc:creator>Former Member</dc:creator><description>Hi Dennis,

The generation got incremented after disabling the server events.

I have found the cause of the issue by disabling each custom server event on Part itemtype and fixed it.

The error occurred due to a null check not being done which threw &amp;quot;Object reference not set to an instance of an object&amp;quot; error.

Thank you very much for your help!!

- Charita

&amp;nbsp;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to increment Revision of "Affected Item" under ECN using AML code</title><link>https://www.aras.com/community/thread/74?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 10:54:24 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:149f4dfd-d433-45fa-8512-8980a3d6170f</guid><dc:creator>Dennis Lindinger</dc:creator><description>My best guess is that you have a method hooked on the part itemtype that is being triggered when you issue the version command and that method is throwing the error. Here are some things to try (in no particular order).

#1
&lt;ol&gt;
 	&lt;li&gt;delete the part 100 you created earlier&lt;/li&gt;
 	&lt;li&gt;rerun the aml to create the part&lt;/li&gt;
 	&lt;li&gt;Run this AML to version&lt;/li&gt;
&lt;/ol&gt;
&amp;lt;Item action=&amp;quot;version&amp;quot; type=&amp;quot;Part&amp;quot; id=&amp;quot;7DF530C86F6B49B8A08996E990C5BFAB&amp;quot; &lt;strong&gt;serverEvents=&amp;quot;0&amp;quot;/&lt;/strong&gt;&amp;gt;

If that is successful, then I&amp;#39;m pretty sure there is a method hooked that is throwing an error.

#2
&lt;ol&gt;
 	&lt;li&gt;Retest in an out-of-the-box database to confirm that my environment and your environment are both working the same&lt;/li&gt;
&lt;/ol&gt;
#3
&lt;ol&gt;
 	&lt;li&gt;Temporarily unhook the part&amp;#39;s server events&lt;/li&gt;
 	&lt;li&gt;retest with the aml&lt;/li&gt;
&lt;/ol&gt;
#4
&lt;ol&gt;
 	&lt;li&gt;What happens if you create a part in the UI&lt;/li&gt;
 	&lt;li&gt;Save, unlock, and close the part&lt;/li&gt;
 	&lt;li&gt;Edit the part in the UI&lt;/li&gt;
 	&lt;li&gt;Save, unlock and close the part&lt;/li&gt;
 	&lt;li&gt;Any errors?&lt;/li&gt;
&lt;/ol&gt;
Also, in the OOTB environment, the Affected Item ItemType is not versionable. Is it in yours? Are you trying to version the affected item or the part that is referenced on the affected item?

Dennis&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to increment Revision of "Affected Item" under ECN using AML code</title><link>https://www.aras.com/community/thread/75?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 10:26:16 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:d0a00e66-3db0-4f45-870c-05362214ee08</guid><dc:creator>Former Member</dc:creator><description>Hi Dennis,

The Part got created successfully with generation &amp;quot;1&amp;quot; as per the first code, but failed to create a new generation(2) using the below code in NASH -

&amp;lt;AML&amp;gt;
&amp;lt;Item type=&amp;quot;Part&amp;quot; action=&amp;quot;version&amp;quot; id=&amp;quot;12345678901234567890123456789012&amp;quot;/&amp;gt;
&amp;lt;/AML&amp;gt;

Error in NASH - &amp;quot;Object reference not set to an instance of an object&amp;quot;

&amp;lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=&amp;quot;&lt;a href="http://schemas.xmlsoap.org/soap/envelope/"&gt;&amp;quot;&amp;gt;schemas.xmlsoap.org/.../&amp;quot;&amp;gt;&amp;lt;SOAP-ENV:Body&amp;gt;&amp;lt;SOAP-ENV:Fault&lt;/a&gt; xmlns:af=&amp;quot;&lt;a href="http://www.aras.com/InnovatorFault"&gt;&amp;quot;&amp;gt;www.aras.com/.../faultcode&amp;gt;&amp;lt;faultstring&amp;gt;&amp;lt;![CDATA[Object&lt;/a&gt; reference not set to an instance of an object.]]&amp;gt;&amp;lt;/faultstring&amp;gt;&amp;lt;detail&amp;gt;&amp;lt;af:legacy_detail&amp;gt;&amp;lt;![CDATA[Object reference not set to an instance of an object.]]&amp;gt;&amp;lt;/af:legacy_detail&amp;gt;&amp;lt;af:exception message=&amp;quot;Object reference not set to an instance of an object.&amp;quot; type=&amp;quot;System.NullReferenceException&amp;quot;/&amp;gt;&amp;lt;/detail&amp;gt;&amp;lt;/SOAP-ENV:Fault&amp;gt;&amp;lt;/SOAP-ENV:Body&amp;gt;&amp;lt;/SOAP-ENV:Envelope&amp;gt;

For &amp;quot;Part&amp;quot; itemtype, the generation property is set to Unique in both Aras 9.2 and 11.5 by default

For &amp;quot;Affected Item&amp;quot; itemtype, the generation property is NOT set to Unique in Aras 11.5 but is &amp;quot;Unique&amp;quot; in 9.2 by default.

Please let me know how the  version and generation of the item/Part can be incremented through configuration/code changes(there are already around 400 items available in our instance).

- Charita&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to increment Revision of "Affected Item" under ECN using AML code</title><link>https://www.aras.com/community/thread/70?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 09:15:33 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:226a500b-6843-46ed-ae07-36248fbf8259</guid><dc:creator>Dennis Lindinger</dc:creator><description>Let&amp;#39;s confirm that basics...

In nash or AML Studio, run the following AML

&amp;lt;Item action=&amp;quot;add&amp;quot; type=&amp;quot;part&amp;quot; id=&amp;quot;12345678901234567890123456789012&amp;quot;&amp;gt;
&amp;lt;item_number&amp;gt;100&amp;lt;/item_number&amp;gt;
&amp;lt;/Item&amp;gt;

This should create a new part with item_number=100 and generation 1. This works in an out-of-the-box database. If you have other required properties, then you may need to modify your AML with the additional properties.

Run this AML to make a new generation of the part.

&amp;lt;Item action=&amp;quot;version&amp;quot; type=&amp;quot;Part&amp;quot; id=&amp;quot;12345678901234567890123456789012&amp;quot;/&amp;gt;

Rerun the search for part 100 and you should see generation 2.

Dennis&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to increment Revision of "Affected Item" under ECN using AML code</title><link>https://www.aras.com/community/thread/71?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 08:28:55 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:89682139-17e6-457c-8eb7-32640f7d6649</guid><dc:creator>Former Member</dc:creator><description>Hi Dennis,

Thank you for your response!!

I have used the above code from  the method &amp;quot;PE_ChangeItemTransition&amp;quot;, but unable to find the &amp;quot;versionIds&amp;quot; -

String[] versionIds = items.Select((TSource item) =&amp;gt; item.ID).ToArray();

I am not sure if all the items in the system are to be considered for &amp;quot;items&amp;quot; is in the above line of code (this IList&amp;lt;TSource&amp;gt; items). I have chosen the &amp;quot;type&amp;quot; as &amp;quot;Part&amp;quot; and even tried with the below line to increment the revision of the affItem, but got &amp;quot;Object reference not set to an instance of an object&amp;quot; error.

Item myItem= inn.applyAML(&amp;quot;&amp;lt;AML&amp;gt;&amp;lt;Item type=&amp;#39;Part&amp;#39; action=&amp;#39;version&amp;#39; id=&amp;#39;&amp;quot;+affItem.getID()+&amp;quot;&amp;#39;/&amp;gt;&amp;lt;/AML&amp;gt;&amp;quot;);

Please note that the revision is not incremented in Aras 11.5 where as the code in my first post (action=version) works absolutely fine and increments the &amp;quot;new_item_rev&amp;quot; field under &amp;quot;Affected Item&amp;quot; in Aras 9.2

The only difference which I observed with respect to configuration is - the &amp;quot;&lt;strong&gt;generation&lt;/strong&gt;&amp;quot; property is NOT set to &amp;quot;Unique&amp;quot; in Aras 11.5 by default, but it is set to &amp;quot;&lt;strong&gt;Unique&lt;/strong&gt;&amp;quot; in 9.2 by default (OOTB).

Since the &amp;quot;Versioning&amp;quot; of  &amp;quot;Part&amp;quot; itemtype is set to &amp;quot;&lt;strong&gt;Automatic&lt;/strong&gt;&amp;quot; in both the Aras versions, I suspect that the above change in generation is the cause of the issue.

I have tried in all possible ways, but action=version always fails and need to resolve the issue.

The &amp;quot;new_item_rev&amp;quot; value of an affected item will be incremented whenever a new ECN gets released on that item.
Can you please let me know on how the above revision increment can be achieved in Aras 11.5 through code or configuration changes.

Appreciate your quick response!

-  Charita&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to increment Revision of "Affected Item" under ECN using AML code</title><link>https://www.aras.com/community/thread/55?ContentTypeID=1</link><pubDate>Tue, 20 Dec 2016 14:44:45 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:d4dc5157-8b75-4592-9b91-78d0cd8be45e</guid><dc:creator>Dennis Lindinger</dc:creator><description>This is a snippet of code that does versioning from the method PE_ChangeItemTransition

Item versionItem = Utils.Innovator.newItem(type, &amp;quot;version&amp;quot;);

String idList = String.Join(&amp;quot;,&amp;quot;, versionIds);
versionItem.setAttribute(&amp;quot;idlist&amp;quot;, idList);

Item res = versionItem.apply();

This will make new generations of all of the ids in idlist of the type &amp;quot;type&amp;quot;.

Hope this helps, Dennis&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to increment Revision of "Affected Item" under ECN using AML code</title><link>https://www.aras.com/community/thread/49?ContentTypeID=1</link><pubDate>Mon, 19 Dec 2016 00:41:19 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:264ef2f2-7f85-4652-b1b4-9a6412b4c876</guid><dc:creator>Former Member</dc:creator><description>Hi All,

I have been trying out various ways to fix the issue but unable to fix the above version increment issue in Aras 11.5 instance.

Request you to please suggest me on how to resolve the above issue as it is critical.

&amp;nbsp;

Regards,

Charita V

&amp;nbsp;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to increment Revision of "Affected Item" under ECN using AML code</title><link>https://www.aras.com/community/thread/46?ContentTypeID=1</link><pubDate>Thu, 15 Dec 2016 01:03:17 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:cbff5eba-78ee-439c-97f8-c19cd2f99bfc</guid><dc:creator>Former Member</dc:creator><description>Hi All,

I excluded the &amp;quot;action=version&amp;quot; and tried to manually increment the revision using the below code, but it did not work.

Item newAff = affItem;
newAff.setID(affItem.getID());
newAff.setAttribute(&amp;quot;select&amp;quot;,&amp;quot;new_item_rev&amp;quot;);
newAff.setProperty(&amp;quot;new_item_rev&amp;quot;,string.Format(&amp;quot;{0:00}&amp;quot;, Int32.Parse(affItem.getProperty(&amp;quot;affected_rev&amp;quot;))+1));
newAff = newAff.apply();

Can someone please help me in resolving the above Revision increment issue.

Thank you in advance!!

Regards,
Charita

&amp;nbsp;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>