Promote Related Items When Source Item is Promoted

Does anyone have a solution to promote related items, once a source item gets promoted?  
Parents
  • 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;

Reply
  • 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;

Children
No Data