Bali - Tuesday, October 2, 2012 2:30 AM:
Will the isTemp and isNew attribute help in anyway? I could not figure out, any help would be deeply appreciated.
Regards,
Bali
RobMcAveney - Tuesday, October 2, 2012 10:11 AM:
See the Programmer's Guide, section 7.9. You can either create one Item/Relationship/Item structure that adds the Assembly and Parts together, like this:
<Item type="Part" action="add">
<item_number>Assembly</item_number>
<Relationships>
<Item type="Part BOM" action="add">
<related_id>
<Item type="Part" action="add">
<item_number>Part 1</item_number>
</Item>
</related_id>
</Item>
...
</Relationships>
</Item>
or you can use ApplyAML instead of ApplyItem. Everything inside an <AML> tag is treated as a single transaction. For example:
<AML>
<Item type="Part" action="add">
<item_number>Assembly</item_number>
</Item>
<Item type="Part" action="add">
<item_number>Part 1</item_number>
</Item>
<Item type="Part BOM" action="add">
<source_id>
<Item type="Part" action="get">
<item_number>Assembly</item_number>
</Item>
</source_id>
<related_id>
<Item type="Part" action="get">
<item_number>Part 1</item_number>
</Item>
</related_id>
</Item>
...
</AML>
Bali - Tuesday, October 2, 2012 11:21 AM:
{
//My entire set of logic (validating and forming runtime AML) goes here. Parts will be created individually and connected separately.
}
Commit transaction();
{
Abort Transaction();
}