Error in AML

I'm trying to run relationship grid from my itemtype "MIN_DELIVERED_COMPONENT" MIN_DELIVERED_COMPONENT item_number = 'CNDF269273' MIN_RMA_PARTS item_number = 'CNDF269273' source_id = '707989C8059F407283DFB1446BE2E144' MIN_RMA id = '707989C8059F407283DFB1446BE2E144'   When I run this AML I don't get any results back, but if change the "id></id>" section to <id>707989C8059F407283DFB1446BE2E144</id> its works. I checked the select statement in SQL studio and it returns "707989C8059F407283DFB1446BE2E144" <AML> <Item type="MIN_RMA" action="get" select = "rma_no"> <id> (SELECT innovator.MIN_RMA.id FROM  innovator.MIN_DELIVERED_COMPONENT INNER JOIN innovator.MIN_RMA_PARTS ON innovator.MIN_DELIVERED_COMPONENT.item_number = innovator.CNDF269273.item_number INNER JOIN innovator.MIN_RMA ON innovator.MIN_RMA_PARTS.source_id = innovator.MIN_RMA.id WHERE (innovator.MIN_DELIVERED_COMPONENT.item_number = 'CNDF269273')) </id> </Item> </AML>
  • Hello, Typically, anything inside of a property tag like <id/> in an AML query will be processed as plain text. The SQL query within it will not be evaluated as you're expecting. Instead, I'd recommend moving this query to a where clause like the following.
    <AML>
    <Item type="MIN_RMA" action="get" select="rma_no" where="[MIN_RMA].id in (SELECT innovator.MIN_RMA.id FROM innovator.MIN_DELIVERED_COMPONENT INNER JOIN innovator.MIN_RMA_PARTS ON innovator.MIN_DELIVERED_COMPONENT.item_number = innovator.CNDF269273.item_number INNER JOIN innovator.MIN_RMA ON innovator.MIN_RMA_PARTS.source_id = innovator.MIN_RMA.id WHERE (innovator.MIN_DELIVERED_COMPONENT.item_number = 'CNDF269273'))"/>
    </AML>
    Including this SQL inside of a where attribute will allow it to be evaluated as you're expecting. Please note that for security reasons, this kind of AML that uses SQL inside of the where clause will only be allowed to run from the server such as through a Server Method. Chris
    Christopher Gillis Aras Labs Software Engineer