This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SUPPORT Q&A - Generating a report by using relationship as search criteria

Alice - Tuesday, November 24, 2015 2:03 PM:

I am trying to generate a report to show ONLY ECRs that have PR items linked to it. I first tried to test using a specific search for ECRs with PR-100006 attached, which should only return one instance, but it seems to have generated every ECRs in the system and spelled out every PR relationship when they exist instead of showing the one ECR that has a relationship with PR-100006.

 

<AML>

    <Item type="ECR" action="get" select="item_number">

        <Relationships>

            <Item type="ECR PR" action="get" select="item_number">

                <item_number condition="eq">pr-100006</item_number>

            </Item>

        </Relationships>

    </Item>

</AML> 

 

Can someone please show me how I would rewrite the AML so:

1. I can search on a relationships criteria 

2. I can generate a report to show ONLY ECRs that have PR relationships?



tstickel - Friday, November 27, 2015 10:32 AM:

Alice:

For #1 (search on a relationships criteria for ECRs that are related to PR-100006):

<AML>

    <Item type="ECR" action="get" select="item_number">

        <Relationships>

            <Item type="ECR PR" action="get" select="related_id">

                <related_id>

                    <Item type="PR" action="get" select="item_number">

                        <item_number condition="eq">PR-100006</item_number>

                    </Item>

                </related_id>

            </Item>

        </Relationships>

    </Item>

</AML> 

 

For #2 (search for ECRs that have PR relationships):

<AML>

    <Item type="ECR" action="get" select="item_number">

        <Relationships>

            <Item type="ECR PR" action="get" select="related_id">

                <related_id>

                    <Item type="PR" action="get" select="item_number">

                        <item_number condition="like">PR%</item_number>

                    </Item>

                </related_id>

            </Item>

        </Relationships>

    </Item>

</AML>

 

Disclaimer: I did not run these AML's, but I believe they are correct.  But I will try to do so later this weekend.  Also, there is probably a simpler <AML> for #2 that does not require accessing the PR itemtype.