<?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>Promote Related Items When Source Item is Promoted</title><link>https://www.aras.com/community/f/development/3318/promote-related-items-when-source-item-is-promoted</link><description>Does anyone have a solution to promote related items, once a source item gets promoted?</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Promote Related Items When Source Item is Promoted</title><link>https://www.aras.com/community/thread/2894?ContentTypeID=1</link><pubDate>Mon, 20 May 2019 07:07:55 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:7d2b1df7-e459-4fee-a1fe-5248df5fc583</guid><dc:creator>AngelaIp</dc:creator><description>&lt;p&gt;Just as second opinion to this use case:&lt;/p&gt;
&lt;p&gt;We wanted to do something similiar, but&lt;span style="font-family:inherit;"&gt;&amp;nbsp;decided to choose a different approach. Instead of releasing all related item automatically, we added a precheck that allows the promotion of the source item only when all related items are released. We use this check mainly for BOM items.&lt;/span&gt;&lt;span style="font-family:inherit;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Background: The risk that you automatically release items that contain errors is very high, espcially when you have very large BOMs with hundrests ot items.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In the beginning, this approach will lead to a huge amount of work cause everything has to be reviewed. But you will soon reach a state, where your most use related items are released. So later you&lt;span style="font-family:inherit;"&gt;&amp;nbsp;just have to take care for the unreleased items and don&amp;acute;t have to check all elements in your relationship again and again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Espcially for large BOM this of course means a lot of work in the beginning. But after some time you will save a lot of time.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Promote Related Items When Source Item is Promoted</title><link>https://www.aras.com/community/thread/2892?ContentTypeID=1</link><pubDate>Fri, 17 May 2019 10:58:49 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:350e1691-12a0-4499-9077-60b9fc0dc825</guid><dc:creator>alibasha</dc:creator><description>&lt;p&gt;can you tri with this code&lt;/p&gt;
&lt;p&gt;Innovator inn=this.getInnovator();&lt;/p&gt;
&lt;p&gt;string state=this.getProperty(&amp;quot;state&amp;quot;,&amp;quot;&amp;quot;);&lt;/p&gt;
&lt;p&gt;string target=&amp;quot;&amp;quot;;&lt;/p&gt;
&lt;p&gt;if(state==&amp;quot;Priliminary&amp;quot;)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;target=&amp;quot;In Review&amp;quot;;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;inn.applymethod(&amp;quot;secondmethod&amp;quot;&amp;lt;id&amp;gt;&amp;quot;+this.getID()+&amp;quot;&amp;lt;/id&amp;gt;&amp;quot;+&amp;lt;state&amp;gt;&amp;quot;+target+&amp;quot;&amp;lt;/state&amp;gt;&amp;quot;);&lt;/p&gt;
&lt;p&gt;in second method&amp;nbsp;you will write this code&lt;/p&gt;
&lt;p&gt;Innovator inn=this.getInnovator();&lt;/p&gt;
&lt;p&gt;string id=this.getProperty(&amp;quot;id&amp;quot;);&lt;/p&gt;
&lt;p&gt;string target=this.getProperty(&amp;quot;state&amp;quot;);&lt;/p&gt;
&lt;p&gt;Item ite=inn.newItem(&amp;quot;part document&amp;quot;,,&amp;quot;get&amp;quot;);&lt;/p&gt;
&lt;p&gt;ite.setAttribute(&amp;quot;where&amp;quot;,&amp;quot;[part document].source_id=&amp;#39;&amp;quot;+id+&amp;quot;&amp;#39;&amp;quot;);&lt;/p&gt;
&lt;p&gt;ite=ite.apply();&lt;/p&gt;
&lt;p&gt;Aras.Server.Security.Identity tempid=Aras.Server.Security.Identity.GetByName(&amp;quot;Aras PLM&amp;quot;);&lt;/p&gt;
&lt;p&gt;bool perm=Aras.Server.Security.Identity.Permissions.GrantIdentity(tempid)&lt;/p&gt;
&lt;p&gt;for(int i=0;i&amp;lt;ite.getItemCount();i++)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;Item itl=ite.getItemByIndex(i);&lt;/p&gt;
&lt;p&gt;Item il=inn.newItem(&amp;quot;document&amp;quot;,&amp;quot;get&amp;quot;);&lt;/p&gt;
&lt;p&gt;il.setAttribute(&amp;quot;where&amp;quot;,&amp;quot;[document].id=&amp;#39;&amp;quot;+itl.getProperty(&amp;quot;related_id&amp;quot;)+&amp;quot;&amp;#39;&amp;quot;);&lt;/p&gt;
&lt;p&gt;il=il.apply();&lt;/p&gt;
&lt;p&gt;string m1=il.getProperty(&amp;quot;state&amp;quot;);&lt;/p&gt;
&lt;p&gt;if(m1!=target)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;il.setAction(&amp;quot;promoteItem&amp;quot;);&lt;/p&gt;
&lt;p&gt;il.setProperty(&amp;quot;state&amp;quot;,target);&lt;/p&gt;
&lt;p&gt;il=il.apply();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;if(perm==true)&lt;/p&gt;
&lt;p&gt;revoke the permisssiona in place of grantprem try revoke.&lt;/p&gt;
&lt;p&gt;return this;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Promote Related Items When Source Item is Promoted</title><link>https://www.aras.com/community/thread/2842?ContentTypeID=1</link><pubDate>Fri, 03 May 2019 15:00:28 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:3fb6944c-e3e6-4342-b7c3-004085d2a241</guid><dc:creator>Florian12</dc:creator><description>&lt;p&gt;Hello, &lt;br /&gt;I am facing the same issues and have no clue how to program with AML. &lt;br /&gt;Have you any code you can share? This would help a lot&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Florian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Promote Related Items When Source Item is Promoted</title><link>https://www.aras.com/community/thread/767?ContentTypeID=1</link><pubDate>Tue, 22 Aug 2017 01:53:31 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:04f0c6d3-b9c3-419b-85df-095fe4b6119b</guid><dc:creator>Former Member</dc:creator><description>Hi Yoann,
same case, I am also facing.

I have attached some related items of item type &amp;quot;CAD&amp;quot; using relationships in &amp;quot;Part&amp;quot; item type instance. Part has it&amp;#39;s own workflow and Lifecycle. I can promote the part using promotions in workflow.

&lt;strong&gt;&amp;quot;While promoting Part, I want to promote the state of related items(CAD Docs) also.&lt;/strong&gt;&amp;quot;&lt;strong&gt; &lt;/strong&gt;
Que 1.- Is it mandatory to create a separate workflow for &amp;quot;CAD&amp;quot; item type ? (I do not want extra notifications in &amp;quot;My basket&amp;quot; for CAD  Doc promotion)

Que 2- Is there is any way to control lifecycle of related item (CAD DOC) directly using server methods from &amp;quot;Part&amp;quot; workflow..?
If yes, Please share some sample code...

Right now I am using this in server event on &amp;quot;Part&amp;quot; workflow-
&lt;strong&gt;(CAD item type has sepearate Lifecycle with no workflow process)&lt;/strong&gt;

Aras.Server.Security.Identity roleIden = Aras.Server.Security.Identity.GetByName(&amp;quot;Owner&amp;quot;); //–Your Transition&amp;#39;s Role here

bool SetPermission = Aras.Server.Security.Permissions.GrantIdentity(roleIden);

var cad_docs = &amp;quot;&amp;lt;Item type=&amp;#39;CAD&amp;#39; action=&amp;#39;promoteItem&amp;#39; where=\&amp;quot;[CAD].item_number=&amp;#39;&amp;quot;+itm_num+&amp;quot;&amp;#39;\&amp;quot;&amp;gt;&amp;quot; +

&amp;quot;&amp;lt;state&amp;gt;In Review&amp;lt;/state&amp;gt;&amp;quot; +

&amp;quot;&amp;lt;/Item&amp;gt;&amp;quot;;0

doc_itm.loadAML(cad_docs);

var results = doc_itm.apply();
It&amp;#39;s showing error &lt;strong&gt;&amp;quot;Internal Error: failed to get the transition to promote the CAD from Preliminary to In Review&amp;quot;.&lt;/strong&gt;

Any help is appreciated and thanks in advance.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Promote Related Items When Source Item is Promoted</title><link>https://www.aras.com/community/thread/616?ContentTypeID=1</link><pubDate>Tue, 11 Jul 2017 12:13:45 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:99aaf930-4eb9-4a82-bfd9-f3061ef0e920</guid><dc:creator>Yoann Maingon</dc:creator><description>Hi,

The topic can be wide !

Can you precise the Use-case?

Are you running a promotion using an ECO/ECN or simply doing a manual promotion?

If ECO, then the children should be selected and planned for promotion too.

If manual promotion you might want to run a server side method on the trigger &amp;quot;onafterpromote&amp;quot; which will look for children and promote them based on your business rules.

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