<?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>Creating Relationship</title><link>https://www.aras.com/community/f/development/4059/creating-relationship</link><description>I am having a problem with creating a relationship between two item types.&amp;#160; I have an extension to projects where we have our own part record (HPP) with additional data.&amp;#160; The relationship between that HPP part record and the project is done through the</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Creating Relationship</title><link>https://www.aras.com/community/thread/2316?ContentTypeID=1</link><pubDate>Mon, 26 Nov 2018 13:25:41 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:4ee416ac-e610-46c9-a126-d0766b395d9b</guid><dc:creator>Mark Lawrence</dc:creator><description>Christopher,

&amp;nbsp;

Thank you!!!   That edit was the missing part!!  It is now working perfectly!!!

&amp;nbsp;

Mark&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Creating Relationship</title><link>https://www.aras.com/community/thread/2315?ContentTypeID=1</link><pubDate>Mon, 26 Nov 2018 11:35:40 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:6ff5c18f-8c4b-4c58-bbd8-0a68f2d35d6a</guid><dc:creator>Christopher Gillis</dc:creator><description>Hi Mark,

We typically recommend adding relationships as part of an update on the parent item. To do this, the code provided would need to be updated slightly like the sample below.

&lt;pre&gt;&lt;code&gt;HPP.setAction(&amp;quot;edit&amp;quot;); // Indicate that we&amp;#039;re editing the parent item
Item partCustLink = HPP.createRelationship(&amp;quot;HPPC&amp;quot;, &amp;quot;add&amp;quot;);
partCustLink.setRelatedItem(HPC);
HPP = HPP.apply();&lt;/code&gt;&lt;/pre&gt;


Chris

&lt;hr /&gt;

Christopher Gillis

Aras Labs Software Engineer&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>