Home Forums Community Display affected items in email notification

This topic contains 4 replies, has 2 voices, and was last updated by  dkinsley 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11343

    dkinsley
    Participant

    I have an email notification that Innovator sends when the change notice has been approved. It currently only has the CN number, engineer’s name, business unit, etc. but does not have the affected items with their part dispositions. I need to add this information to the email notification. My message uses Body Html and a AML query string. How do I modify these to include all of the affected items table information?

    #11346

    dkinsley
    Participant

    I am able to get data from the CN such as the id, cn_number, businessunit, top_assy_pn, etc.

    What I need is how to script to get the related source_id of the Affected Items. Is it something like this?

    </Item>
    <Item type=”a_CN_Affected_Item” action=”get” where=[a_CN_Affected_Item].<source_id>{id}</source_id> select=”affected_name”>
    </Item>

    #11347

    dkinsley
    Participant

    The upper part of script works correctly. The last “Item type” section… I am having trouble trying to figure out how to state the affected item source id is the id of the CN. Can someone help?

    <Item type=”a_CN” action=”get” select=”id,cn_number,title,a_businessunit,customer(keyed_name),top_assy_pn(keyed_name),team_id,change_reason,change_summary”>
    <id>${Item/id}</id>
    <team_id>
    <Item type=”Team” action=”get”>
    <Relationships>
    <Item type=”Team Identity” action=”get”>
    <team_role>52C5CF6C021A443D845CF6F623EF48C4</team_role>
    <related_id>
    <Item type=”Identity” action=”get” select=”name”></Item>
    </related_id>
    </Item>
    </Relationships>
    </Item>
    </team_id>
    </Item>
    <Item type=”a_CN_Affected_Item” action=”get” where=”[a_CN_Affected_Item].source_id=${Item/id}” select=”affected_name”>
    </Item>

     

    #11708

    Eric Domke
    Participant

    Assuming a_CN_Affected_Item is a relationship, then the following would be the simplest way to accomplish what you want.

    <Item type="a_CN" action="get" select="id,cn_number,title,a_businessunit,customer(keyed_name),top_assy_pn(keyed_name),team_id,change_reason,change_summary">
      <id>${Item/id}</id>
      <team_id>
        <Item type="Team" action="get">
          <Relationships>
            <Item type="Team Identity" action="get">
              <team_role>52C5CF6C021A443D845CF6F623EF48C4</team_role>
              <related_id>
                <Item type="Identity" action="get" select="name"></Item>
              </related_id>
            </Item>
          </Relationships>
        </Item>
      </team_id>
      <Relationships>
        <Item type="a_CN_Affected_Item" action="get" select="affected_name">
        </Item>
      </Relationship>
    </Item>

    As a separate query, both of the following should also work

    <Item type="a_CN_Affected_Item" action="get" where="[a_CN_Affected_Item].source_id=${Item/id}" select="affected_name">
    </Item>

    OR

    <Item type="a_CN_Affected_Item" action="get" select="affected_name">
      <source_id>${Item/id}</source_id>
    </Item>
    #11709

    dkinsley
    Participant

    Eric,

    Will this script get all of the affected items if there are more than one row of them?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.