Forum Discussion

lucas's avatar
lucas
Ideator I
5 years ago
Solved

get property list from item type, issue reading the result item

hello, i want to get a list of names of propreties that start a certain way 'z%'. i've found aml that was supposed to do it, i' made an iom code to recrate that aml (actually creates the right aml)...
  • AngelaIp's avatar
    5 years ago

    Your result contains items of two ItemTypes. The parent itemtype (1 item) and the sub-itemtype (many items).

    Try to filter your result with xpath:

    Item myprops = yourresult.getItemsByXPath("//Item[@type='Property']");

    You can throw a log entry with the amount of properties by using myprops.getItemCount();

    And maybe use PropertyCondition instead of "Where" to apply the filter. Is more secure according to Aras:

    Item myParts= this.newItem("Part", "get");
    myParts.setAttribute("select", "item_number");
    myParts.setPropertyCondition("item_number", "like");
    myParts.setProperty("item_number", "C123%");