Vault Customization

Vault Customization

Reply
Valued Contributor
gary.belisle
Posts: 94
Registered: ‎07-29-2011
Message 1 of 3 (138 Views)

Class Item.ControlledByChangeOrder

138 Views, 2 Replies
08-24-2012 06:21 AM

If I have an Item as a record on a Change Order in Vault Pro 2012, is there a way to add/remove an attachment for that Item with the API?

 

In the VaultAPI help under Class Item - Properties, there is ControlledByChangeOrder as Boolean. The description says "If true, item is being controlled by a Change Order and certain properties cannot be manually changed."

 

What are those "certain properties"?

 

Can an Item be temporarily removed from a Change Order, add/remove the attachment, and then added back on? This would break the ability to Roll-back the Lifecycle state for the Item in the ECO though so I want to avoid that.

 

Any ideas?

 

I will accept it can't be done as a valid answer if that is the case. I'll use the ControlledByChangeOrder property to output an error log.

 

---------------------------------------------------------------------
i7-2720QM Dell Precision M6600, Win 7 Pro 64-bit, 8GB RAM
Autodesk Product Design Suite Ultimate 2013
Autodesk Vault Professional 2013
ADN Support Specialist
wayne.brill
Posts: 252
Registered: ‎08-25-2004
Message 2 of 3 (122 Views)

Re: Class Item.ControlledByChangeOrder

08-29-2012 02:09 PM in reply to: gary.belisle
Spoiler
 

Hi,

 

I asked a colleague about this. Here is the reply:

 

>> >>

If I have an Item as a record on a Change Order in Vault Pro 2012, is there a way to add/remove an attachment for that Item with the API?

 

You can add and remove attachments on Items using either the UpdateAndCommitItem() or the UpdateItem() methods on the ItemService. Each of the methods has a parameter named Attachments that is an array of Attmt objects. Use these methods to update the item to remove or add attachments. Remember, though, that you need to first get an editable instance of the Item you want to edit by calling EditItem() on the ItemService.

 

In the VaultAPI help under Class Item - Properties, there is ControlledByChangeOrder as Boolean. The description says "If true, item is being controlled by a Change Order and certain properties cannot be manually changed."

 What are those "certain properties"?

 

I’m not sure exactly which properties are prevented from being modified. I believe adding attachments to an item solely depends on the lifecycle state of the item (which can be controlled by change orders if their vault is configured that way). As far as I’m aware (from messing around a bit), things like the item’s lifecycle state and effectivity are affected, but attachments are not.  It would probably be easiest to simply set up an item with a change order and one without and try editing them the way you intend to and see if these actions are permitted.

 

Can an Item be temporarily removed from a Change Order, add/remove the attachment, and then added back on? This would break the ability to Roll-back the Lifecycle state for the Item in the ECO though so I want to avoid that.

 

You can add and remove items from a change order using the UpdateChangeOrder() method on the ChangeOrderService. The parameters you’ll be interested in are the addItemMasterIds and the delItemMasterIds. These parameters are both arrays of longs. By adding the master Id of the item you want to add/remove to the appropriate array, you can update the items associated with the change order. You must first call EditChangeOrder() from the ChangeOrderService to get an editable change order, though. I believe whether or not you can update a change order is dependent upon its lifecycle state, too.

 

Any ideas?

I will accept it can't be done as a valid answer if that is the case. I'll use the ControlledByChangeOrder property to output an error log.

 

I’ve done very limited playing around with the above API methods. I think what would be best is to just play around in Vault Explorer to determine under which scenarios it might not work to simply update the item. It doesn’t strike me as a great idea to remove the item from the change order just to add and attachment and then add it back to the change order again. Vault explorer typically behaves by displaying the restriction you get from the server and let the user correct the situation. More information on change orders and items can be found on the wiki here: http://wikihelp.autodesk.com/Vault/enu/Help/Help/0001-Using_Va1/0034-Work_wit34/0036-Manage_C36.

<< <<

 

Thanks,



Wayne Brill
Developer Technical Services
Autodesk Developer Network

Valued Contributor
gary.belisle
Posts: 94
Registered: ‎07-29-2011
Message 3 of 3 (114 Views)

Re: Class Item.ControlledByChangeOrder

08-31-2012 10:42 AM in reply to: wayne.brill

Thanks for the reply. I was thinking about this more. Could it be possible that because an Item on a Change Order cannot be edited that the Change Order itself needs to be put in an editable state first?

---------------------------------------------------------------------
i7-2720QM Dell Precision M6600, Win 7 Pro 64-bit, 8GB RAM
Autodesk Product Design Suite Ultimate 2013
Autodesk Vault Professional 2013
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.