Aras Community

Welcome to Aras Community Sign in | Join | Help
in Search
Aras Community
Please Also Visit the Project Site to Download Add-Ons and Solutions
Jump to Projects

Creating BOM with existing parts (AML)

Last post 11-07-2008, 10:51 AM by Rob McAveney. 2 replies.
Sort Posts: Previous Next
  •  11-05-2008, 6:39 PM 1141

    Creating BOM with existing parts (AML)

    Hi

     I'd like to add existing parts to an existing part BOM.  All the examples that I've seem relates to adding new parents and children.

     I.e.  This is a typical example that I've read.

    <AML>
    <Item type="Part" action="add">
      <item_number>801-0150-70-01</item_number>
      <Relationships>
        <Item type="Part BOM" action="add">
          <quantity>1</quantity>
            <related_id>
              <Item type="Part" action="add">
                <item_number>446-0445-01-01</item_number>
              </Item>
            </related_id>
        </Item>
      </Relationships>
    </Item>
    </AML>

    But this returns an error as the parent already exists (as does the child).

     Thanks

    Carlo

  •  11-06-2008, 4:01 PM 1142 in reply to 1141

    Re: Creating BOM with existing parts (AML)

    Carlo

    You do have the correct idea with what you want to do but you just need to change the actions attributed to each <Item> tag.  To be able to Add an existing Part to a Part BOM relationship for a part that exists as well just look at the actions I have edited and highlighted.

    <AML>
    <Item type="Part" action="edit">
      <item_number>801-0150-70-01</item_number>
      <Relationships>
        <Item type="Part BOM" action="add">
          <quantity>1</quantity>
            <related_id>
              <Item type="Part" action="get">
                <item_number>446-0445-01-01</item_number>
              </Item>
            </related_id>
        </Item>
      </Relationships>
    </Item>
    </AML>

     The reason for the error is due to the fact when you use action="add" you are attempting to create a new item, in this case a new part.  In the case of part the property item_number is unique so it is erroring due to the fact you are trying to add a part with an item_number that already exists.

    Hope this helps.

    Sean

  •  11-07-2008, 10:51 AM 1145 in reply to 1142

    Re: Creating BOM with existing parts (AML)

    Just to clarify a bit, when using action="edit" you need to specify exactly which item you are editing.  The most common way to do this is by setting  the id attribute, like this:

     <Item type="Part" action="edit" id="8AD6FC0422494CD3BF5D5CD4204E7F74" >

    If you don't have the id of the item, the next best way to do it is with the where attribute, like this:

     <Item type="Part" action="edit" where="[PART].item_number='801-0150-70-01' and [PART].is_current='1'" >

    The "is_current" condition just makes sure you are editing the latest version of the Part.

    Rob

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems