Display affected items in email notification

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?
  • 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>
  • 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>  
  • 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>
  • Eric, Will this script get all of the affected items if there are more than one row of them?