How to Update the value of xClasss xProperty by AML or API?

Hi Eli, How to Update the value of  xClasss xProperty via API or AML? I can get the value of an xProperty  via MyItem.getProperty("xp-MyPropertyName") or AML. But I failed to update xProperty this way. Item MyItem = innovator.newItem("Part","edit"); MyItem.setID("xxxxxxxx"); MyItem.setProperty("xp-length","10"); MyItem.apply();   Lin    
Parents
  • Hi Lin, If your xProperty is already defined, try setting the set attribute on the xProperty like this:
    Item MyItem = innovator.newItem("Part","edit");
    MyItem.setID("xxxxxxxx");
    MyItem.setProperty("xp-length","10");
    MyItem.setPropertyAttribute("xp-length","set","value");
    MyItem.apply();
    This code will result in AML like this:
    <Item type="Part" action="edit" id="xxxxxxxx">
       <xp-length set="value">10<xp-length/>
    </Item>
    Eli
    Eli Donahue Aras Labs Software Engineer
Reply
  • Hi Lin, If your xProperty is already defined, try setting the set attribute on the xProperty like this:
    Item MyItem = innovator.newItem("Part","edit");
    MyItem.setID("xxxxxxxx");
    MyItem.setProperty("xp-length","10");
    MyItem.setPropertyAttribute("xp-length","set","value");
    MyItem.apply();
    This code will result in AML like this:
    <Item type="Part" action="edit" id="xxxxxxxx">
       <xp-length set="value">10<xp-length/>
    </Item>
    Eli
    Eli Donahue Aras Labs Software Engineer
Children
  • Hi Eli,

    We added extended classifications to our PART itemtype after we had already established thousands of records for parts. How can I do a global update to all parts and set the "extended property value". I try to create a method to update parts , but it gives me an error "You tried to perform "update" operation against not defined Extended Properties". I'm assuming because the parts were created before we setup "extended classifications"