Promote Related Items When Source Item is Promoted

Does anyone have a solution to promote related items, once a source item gets promoted?  
  • 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 "onafterpromote" which will look for children and promote them based on your business rules.  
  • Hi Yoann, same case, I am also facing. I have attached some related items of item type "CAD" using relationships in "Part" item type instance. Part has it's own workflow and Lifecycle. I can promote the part using promotions in workflow. "While promoting Part, I want to promote the state of related items(CAD Docs) also."  Que 1.- Is it mandatory to create a separate workflow for "CAD" item type ? (I do not want extra notifications in "My basket" for CAD  Doc promotion) Que 2- Is there is any way to control lifecycle of related item (CAD DOC) directly using server methods from "Part" workflow..? If yes, Please share some sample code... Right now I am using this in server event on "Part" workflow- (CAD item type has sepearate Lifecycle with no workflow process) Aras.Server.Security.Identity roleIden = Aras.Server.Security.Identity.GetByName("Owner"); //–Your Transition's Role here bool SetPermission = Aras.Server.Security.Permissions.GrantIdentity(roleIden); var cad_docs = "<Item type='CAD' action='promoteItem' where=\"[CAD].item_number='"+itm_num+"'\">" + "<state>In Review</state>" + "</Item>";0 doc_itm.loadAML(cad_docs); var results = doc_itm.apply(); It's showing error "Internal Error: failed to get the transition to promote the CAD from Preliminary to In Review". Any help is appreciated and thanks in advance.
  • can you tri with this code

    Innovator inn=this.getInnovator();

    string state=this.getProperty("state","");

    string target="";

    if(state=="Priliminary")

    {

    target="In Review";

    }

    inn.applymethod("secondmethod"<id>"+this.getID()+"</id>"+<state>"+target+"</state>");

    in second method you will write this code

    Innovator inn=this.getInnovator();

    string id=this.getProperty("id");

    string target=this.getProperty("state");

    Item ite=inn.newItem("part document",,"get");

    ite.setAttribute("where","[part document].source_id='"+id+"'");

    ite=ite.apply();

    Aras.Server.Security.Identity tempid=Aras.Server.Security.Identity.GetByName("Aras PLM");

    bool perm=Aras.Server.Security.Identity.Permissions.GrantIdentity(tempid)

    for(int i=0;i<ite.getItemCount();i++)

    {

    Item itl=ite.getItemByIndex(i);

    Item il=inn.newItem("document","get");

    il.setAttribute("where","[document].id='"+itl.getProperty("related_id")+"'");

    il=il.apply();

    string m1=il.getProperty("state");

    if(m1!=target)

    {

    il.setAction("promoteItem");

    il.setProperty("state",target);

    il=il.apply();

    }

    if(perm==true)

    revoke the permisssiona in place of grantprem try revoke.

    return this;

  • Just as second opinion to this use case:

    We wanted to do something similiar, but 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. 

    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.

    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 just have to take care for the unreleased items and don´t have to check all elements in your relationship again and again.

    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.