MattAPI - Wednesday, July 1, 2009 1:46 PM:
I would like to access the values in a List from the client side. I can access the "name" and "description" of the List easy enough with this:var temp = ListItem.getProperty("name");
However, I don't know how to actually access the values in the List. I see that List has a RelationshipType Value but Value itself is not related to anything?! I don't understand where the actual List values are stored and how to access them. Thanks
SamsAn - Thursday, July 2, 2009 2:46 AM:
Use url like below to launch nash utility: localhost/.../nash.aspx.
ApplyAML like below:
<AML>
<Item type="List" action="get" select="name">
<name condition="like">B%</name>
<Relationships>
<Item type="Value" select="value,label"/>
</Relationships>
</Item>
</AML>
You will get result AML like
<Item type="List" typeId="5736C479A8CB49BCA20138514C637266" id="E6853988495145D0BC14D1CF4E87B740">
So, this result explains how these metadata are orginized.
SamsAn.
Original Mind Any Level Innovator Solutions Free-Lancer, http://sites.google.com/site/caraacc
MattAPI - Tuesday, July 14, 2009 6:05 PM:
Thanks, that's what I needed. I had heard of the Nash tool but hadn't used it yet. That will be helpful. I ended up doing this in a server-side script. Here's the code snippet I ended up using for those who might have the same question:// Create a new query Item for the standard Document names
Item DocNames = myInnovator.newItem("Value","get");
DocNames.setAttribute("select","value");
DocNames.setAttribute("where","source_id=(SELECT id FROM [List] WHERE name='" + standard_doc_list + "')");
DocNames = DocNames.apply();
fli - Thursday, October 21, 2010 3:53 AM:
Hi, I'am trying to query for "list" values with a specific parent list, but it's not worng. Please help me correct it valqry
.setAttribute("where","[Value].source_id ='15A18D6F03204261888375BFD963C997'");
BR
Christoffer
aknourenko - Thursday, October 28, 2010 3:08 PM:
In general I would not recommend to use "where" attribute for such simple cases. If all you need is to find all values for a particular list with ID=xxx then you have to send a simple AML like the following:
<Item type="List" action="get" id="xxx" levels="1" />
Note: "levels=1" means "bring with the item all relationships of the first level".
The only problem with the above AML is that it can bring too much info (all these properties that you might not need); in general it's not a problem but take more time to pass the info over the network. If you want to reduce the amount of information brought back then a bit more complicated AML must be sent:
<Item type="List" id="56BA55F7E40F4CD880854231E7F06D1F" levels="1" select="name|value,label" action="get" config_path=".|Value">
</Item>
The above AML brings only List.name and Value.labelvalue properties (note that ids are always brought back).
Ronan - Thursday, October 28, 2010 4:57 PM:
Hi aknourenko,
I did not know this syntaxselect="property1a,property1b|property2a,property2b,property2c|property3a|..." config_path="xpath1|xpath2|xpath3|..."
and find it very interesting. It can sure get confusing if overused because it kinda obfuscates the structure, but seems great for quick queries.
Tested and working on 9.2.x and 9.1.x , but has it always existed? Is it supported? Any major deal compared to actually defining the structure via nested <Relationship>s and <Item>s?
Thanks for the tip.
aknourenko - Friday, October 29, 2010 10:06 AM:
Yes, it's been in AML for a long time and it's supported.