Quantcast
Channel: aras PLM community
Viewing all articles
Browse latest Browse all 1103

Getting a property value for a related item

$
0
0

I just went through the Developing Solutions class, and am attempting to implement some of the things I learned there. I'm quite new to this level of development, so please bear with me.

I want to get the id of the identity tied to a particular user. I wrote the following code in AML first, with the intent to build the query in a VB method:

 

 

<AML>
  <Item type="User" action="get" where="[User].id='xxxxxxxxxxxxxxxxxxxxxx'">
    <Relationships>
      <Item type="Alias" action="get">
        <related_id>
          <Item type="Identity" action="get" select="id"></Item>
        </related_id>
      </Item>
    </Relationships>
  </Item>
</AML>

This returns the user along with the related identity. I then create the same query in VB:

Dim userID As String = Me.getInnovator().getUserId()
Dim myItem As Item = Me.newItem("User", "get")
myItem.setAttribute("where", "[User].id='" + userID + "'")
Dim relationship As Item = Me.newItem("Alias", "get")
Dim identity As Item = Me.newItem("Identity", "get")
identity.setAttribute("select", "id")
relationship.setRelatedItem(identity)
myItem.addRelationship(relationship)
myItem = myItem.apply()

However, I don't know how to use getProperty here, because the item returned is actually a User item, not the related Identity item. How would I go about getting just the ID of the Identity? Must I return just the Identity item only, or is there a way to reference the nested/related item to get at the needed property?

Thanks.

 

 


Viewing all articles
Browse latest Browse all 1103

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>