Assigning an xPropertyDefinition to an ItemType

When you assign an xProperty to an ItemType, it is referenced in AML as a property of the ItemType. If you do not define an xProperty on an item, it is ignored. The following example gets all the items from the database where weight is equal to 15 and the xProperty cost is equal to 10:

<Item type="Part" action="get" select="item_number, cost, xp-cost">

    <xp-cost>10</xp-cost>
                                            

    <weight>15</weight>
                                            

</Item>
                                            

<Result>
                                            

    <Item type="Part" typeId="3B135425…" id="0FA8ED…">

        <item_number>999-888</item_number>
                                            

        <cost>127</cost>
                                            

        <xp-cost>10</xp-cost>
                                            

    </Item>
                                            

</Result>

Get items example if the user doesn’t have permissions on the xProperty:

Get all part items from the database, where the weight is equal to 15 and the xProperty cost is equal to 10. For each found item return the item_number, cost and xProperty cost (defined explicitly).

User does NOT have “can get” permissions on the xProperty cost.

<Item type="Part" action="get" select="item_number, cost, xp-cost">

    <xp-cost>10</xp-cost>
                                            

    <weight>15</weight>
                                            

</Item>
                                            

<Result>
                                            

    <Item type="Part" typeId="3B135425…" id="0FA8ED…">

        <item_number>999-888</item_number>
                                            

        <cost>127</cost>
                                            

        <xp-cost is_null="0"></xp-cost>
                                            

    </Item>
                                            

</Result>
                   

Get items with “select=*” example:

Get all part items from the database, where the weight is equal to 15 and the xProperty cost (defined explicitly) is equal to 10. The @select attribute is not specified. The xProperty length is defined on the resulting item and has a NULL value. For each found item return all standard properties and all defined xProperties. All properties with the value NULL are not returned.

<Item type="Part" action="get" select="*">

    <xp-cost>10</xp-cost>
                                            

    <weight>15</weight>
                                            

</Item>
                                            

<Result>
                                            

    <Item type="Part" typeId="3B135425…" id="0FA8ED…">

        <item_number>999-888</item_number>
                                            

        <cost>127</cost>
                                            

        ... all NOT NULL standard properties here 

        <xp-cost>10</xp-cost>
                                            

        ... all NOT NULL xProperties defined on this PART item here

    </Item>
                                            

</Result>

Get items without “select” :

Get all part items from the database, where the weight is equal to 15 and the xProperty cost is equal to 10. The xProperty length is defined on the resulting item implicitly. For each found item return all standard properties and all defined xProperties.

<Item type="Part" action="get">

    <xp-cost>10</xp-cost>
                                            

    <weight>15</weight>
                                            

</Item>
                                            

 

 

<Result>
                                            

    <Item type="Part" typeId="3B135425…" id="0FA8ED…">

        <item_number>999-888</item_number>
                                            

        <cost>127</cost>
                                            

        <team_id is_null="1"/>
                                            

        ... all standard properties here 

        <xp-cost>10</xp-cost>
                                            

        <xp-length is_null="1"/>

        ... all xProperties defined on this PART item here

    </Item>
                                            

</Result>

Update item example:

Update the standard property “Cost” value to 128 and xProperty “Cost” (defined explicitly or implicitly) value to 100:

<Item type="Part" action="update" id="0FA8ED...">

    <xp-cost set="value">100</xp-cost>
                                            

    <cost>128</cost>
                                            

</Item>