<?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>How to clear relationship on new Revision?</title><link>https://www.aras.com/community/f/development/3125/how-to-clear-relationship-on-new-revision</link><description>I have an ItemType A with a RelationShip to another ItemType B.

I want all relations to stay within a Revision. But when a new Revision is created for ItemType A I do not want the old relations to be carried over to the new Revision.

Is there any &amp;quot;build</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to clear relationship on new Revision?</title><link>https://www.aras.com/community/thread/98?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2017 02:21:24 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:dd8af317-7adc-4b59-9e73-a8c6b75ff0ae</guid><dc:creator>Former Member</dc:creator><description>Great! I was afraid that the new Revision had not been created yet when the onAfterVersion was called. This is exactly what I want, I just compare that the oldVer.Major_rev != newVer.Major_rev are then removes the relations. Thanks!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to clear relationship on new Revision?</title><link>https://www.aras.com/community/thread/96?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2017 15:39:07 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:b05fc370-a74f-4dc7-a5bd-4d39e3e3712d</guid><dc:creator>Dennis Lindinger</dc:creator><description>In my 11sp6 out of the box environment, the onAfterVersion event is fired when revision B is made from an ECO. The context item of the onAfterVersion event is the old generation (rev A), but your method can retrieve the latest generation based on config_id. This is the approach that PE_AffectedItemFloat uses (also hooked to onAfterVersion). Once you have the new generation, then you can delete the relationships.

As you said, your method will need compare major_revs between generations to determine if it should delete the relationships.

Dennis

&amp;nbsp;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to clear relationship on new Revision?</title><link>https://www.aras.com/community/thread/95?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2017 10:48:54 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:a2140d36-356f-4667-821e-0d3e1a4afbac</guid><dc:creator>Former Member</dc:creator><description>That&amp;#39;s corrrect, I tried the onAfterVersion method but that method is not called when a new Revision is created, or rather that method is called when the last generation of the previous Revision is saved, so I can not delete the relationships on the next Revision using that method.

Modifying PE_ChangeItemTransition seems like a &amp;quot;dirty&amp;quot;  solution for this problem, but if that is the only solution I can try that out. You do not have any other suggestions? Is there any server event method that is called when a new revision is created? If there is, I could easily check if Generation is equals to &amp;quot;A&amp;quot; and then remove the relationships.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to clear relationship on new Revision?</title><link>https://www.aras.com/community/thread/93?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2017 10:10:45 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:c3a8c48b-034a-492f-bb9c-bb755a3d580a</guid><dc:creator>Dennis Lindinger</dc:creator><description>There is no onRevision event that I&amp;#39;m aware of. By onVersion, I am assuming that you mean onBeforeVersion or onAfterVersion. If so, are you hooking the before or after event? I think you&amp;#39;ll want to hook the after. Be aware that the Version events are fired whenever a new generation is created. Therefore, if you have an item A with item B relations, item A is generation 1 in the preliminary state, and you lock item A to make a change creating generation 2, then the version events will fire when you save item A. It&amp;#39;s unlikely that this is the functionality you desire.

If you are using the out of the box change processes, then one option is to make a modification to the PE_ChangeItemTransition method to delete the relationships from the new revisions when that method makes the new revisions of the affected items.

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