<?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>Can you Remove xClass relationship with onChange field event?</title><link>https://www.aras.com/community/f/development/35691/can-you-remove-xclass-relationship-with-onchange-field-event</link><description>I&amp;#39;m trying to clear out the xClass relationship when the class of a part is changed. The code I have below is ran on the filed event of the drop down onChange, however it doesn&amp;#39;t remove the xClass relationship. 
 
 
 var rootItem = document.thisItem;</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Can you Remove xClass relationship with onChange field event?</title><link>https://www.aras.com/community/thread/5297?ContentTypeID=1</link><pubDate>Fri, 19 Jun 2020 19:36:35 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:8e613fac-f00a-4118-acb1-3ea2b630f3d1</guid><dc:creator>Gopikrishnan</dc:creator><description>&lt;p&gt;Hi Robert&lt;/p&gt;
&lt;p&gt;Yes, you can remove the xClass relationship. small change to your code will work&lt;/p&gt;
&lt;p&gt;var rootItem = document.thisItem;&lt;/p&gt;
&lt;p&gt;var &lt;span&gt;xClassRelationship&amp;nbsp;&lt;/span&gt;= rootItem.getRelationships(&lt;span&gt;&amp;quot;Part_xClass&amp;quot;&lt;/span&gt;);&lt;/p&gt;
&lt;p&gt;for (var i = 0; i &amp;lt; &lt;span&gt;xClassRelationship&lt;/span&gt;.getItemCount(); i++)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;var &lt;span&gt;current&amp;nbsp;&lt;/span&gt;= &lt;span&gt;xClassRelationship&lt;/span&gt;.getItemByIndex(i);&lt;/p&gt;
&lt;p&gt;&lt;span&gt;current&lt;/span&gt;.setAction(&amp;#39;delete&amp;#39;);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank You&lt;/p&gt;
&lt;p&gt;Gopikrishnan R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>