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

DEVELOPERS FORUM - AML query result

Gorinich - Monday, April 16, 2012 5:28 AM:

I'm using code below to get top level parts of given part:

var innovator = new Innovator();

var qryItem = innovator.newItem();
qryItem.loadAML('<Item type="Part" id="5CD08C5411594DBE8E3C4056D5EB87FF" action="getItemWhereUsed"/>');
var resultItem = qryItem.apply();

if (resultItem.isError()) {
      top.aras.AlertError("Item not found: " + resultItem.getErrorDetail());
      return;
}

but, i've got message like this as result:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="schemas.xmlsoap.org/.../">
  <SOAP-ENV:Body>
    <Result>
      <Item type="Part" id="5CD08C5411594DBE8E3C4056D5EB87FF" icon="../Solutions/PLM/images/Icons/16x16/16x16_Part.gif" keyed_name="????????? - ? 000001 ? - 001.1" loaded="1">
        <relatedItems>
          <Item type="Part" id="61EE243A01224C789B05B42DD0687243" icon="../Solutions/PLM/images/Icons/16x16/16x16_Part.gif" keyed_name="????????? - ??? 000001 ? - 001.2" />
          <Item type="Part" id="406906847DBC4226A6080B771DA2263C" icon="../Solutions/PLM/images/Icons/16x16/16x16_Part.gif" keyed_name="????????? - ?? 000007 - 001.3" />
          <Item type="Part" id="60E26DFA31F9455FA8BED4D55471CB31" icon="../Solutions/PLM/images/Icons/16x16/16x16_Part.gif" keyed_name="????????? - ?? 000008 - 001.1" />
          <Item type="Part" id="534C488BFE664FE39A409D64A39638F6" icon="../Solutions/PLM/images/Icons/16x16/16x16_Part.gif" keyed_name="????????? - ??? 000001 ? - 001.2" />
          <Item type="Part" id="B14E40F39C474D12B25FE2A6DDAB4D55" icon="../Solutions/PLM/images/Icons/16x16/16x16_Part.gif" keyed_name="????????? - ??? 000001 - 001.4" />
        </relatedItems>
      </Item>
    </Result>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

How to take only items with Part type as array of items?



Yoann Maingon - Monday, April 16, 2012 6:47 AM:

In your example, you realize you have just Parts, right?



Yoann Maingon - Monday, April 16, 2012 7:18 AM:

Got it, well the answer is no. You would need to reprocess your xml result to filter the non-Part items.



Gorinich - Monday, April 16, 2012 8:01 AM:

I need just list of parts with certain substring in keyed_name

Give me example please, still can't figure out which API function to use.

Update

Solved. I've got parts IDs with RegExp.