<?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>delete xclass available on part through code</title><link>https://www.aras.com/community/f/development/21806/delete-xclass-available-on-part-through-code</link><description>Hi everyone, 
 i want to delete xclass available on part through client side action on part itemtype. 
 we can delete it through delete button available in xclass html on Part form, but i want to delete it through client side action on part.</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: delete xclass available on part through code</title><link>https://www.aras.com/community/thread/5098?ContentTypeID=1</link><pubDate>Thu, 21 May 2020 09:35:50 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:2e8ce535-1cda-4eae-9ab9-e2b28742ca8c</guid><dc:creator>R</dc:creator><description>&lt;p&gt;Thanks Gopikrishan for your reply.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: delete xclass available on part through code</title><link>https://www.aras.com/community/thread/5096?ContentTypeID=1</link><pubDate>Wed, 20 May 2020 18:15:21 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:668959c0-ce0a-4e2b-bcb7-923fbdd32b21</guid><dc:creator>Gopikrishnan</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Create New Method and copy paste below Javascript code&lt;/p&gt;
&lt;p&gt;var parentType = parent.item.getAttribute(&amp;#39;type&amp;#39;);&lt;br /&gt;var xClassName = parentType + &amp;#39;_xClass&amp;#39;;&lt;br /&gt;var deleteItem = aras.newIOMItem(xClassName, &amp;#39;get&amp;#39;);&lt;br /&gt;deleteItem.setAttribute(&amp;#39;select&amp;#39;, &amp;#39;related_id(label)&amp;#39;);&lt;br /&gt;deleteItem.setProperty(&amp;quot;source_id&amp;quot;, this.getID());&lt;br /&gt;deleteItem = deleteItem.apply();&lt;br /&gt;for (i = 0; i &amp;lt; deleteItem.GetItemCount(); i++) &lt;br /&gt;{&lt;br /&gt; var xClassRel = deleteItem.getItemByIndex(i);&lt;br /&gt; xClassRel.setAttribute(&amp;quot;version&amp;quot;,&amp;quot;0&amp;quot;);&lt;br /&gt; xClassRel.apply(&amp;quot;delete&amp;quot;);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Navigate to Administration --&amp;gt; Action&lt;/p&gt;
&lt;p&gt;Create New action (Type =&amp;nbsp;Item and Action = Client and Method = above created method)&lt;/p&gt;
&lt;p&gt;Open Part Item type and add this action under Actions tab&lt;/p&gt;
&lt;p&gt;Save and Unlock&lt;/p&gt;
&lt;p&gt;Open any part and under actions you will see the newly created action&lt;/p&gt;
&lt;p&gt;Reopen item to view the changes&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>