Vault Professional 2014.
Vault allows you to create custom Change Order properties by going into ”Tools/Administration/Vault Settings”, Clicking on the “Change Orders” Tab and Clicking the “Properties” button under “Link Properties”.
Once created and active, these properties can be viewed and edited within the Change Order records tab. Each Item can contain a unique value within each property. These properties only exist within the Change Order.
How then, do I extract these values programmatically knowing the Change Order ID and a list of referenced Item ID’s? I used the ChangeOrder.ItemIdArray to get a list of items referenced by the Change Order.
I managed to find the definitions’ for these custom properties using …PropertyService.GetAllAssociationPropertyDefinitions().
This gives me an ID number for the property itself, just not sure where to apply it?
Solved! Go to Solution.
Solved by minkd. Go to Solution.
There is a method in the ChangeOrderService:
AssocPropItem[] GetChangeOrderAssociationProperties( long[] changeOrderIds, long[] propertyListIds, long[] itemListIds )
-Dave
Just what I needed. Unfortunately it doesn't seem to work. I made multiple attempts using the eco, custom definition and item arrays extrqcted from the change order, but get null result for every attempt.
I did the following to test the function. Found an ECO that contains multiple items most with values in at least one of the defined custom fields.
Name: ECO-2013-77 ID: 210262
I used ChangeOrderService.GetAllChangeOrderAssociationPropertyDefinitions() to obtain a list of custom definitions.
Name: ECO Comments ID: 104. This custom field was filled in for most items in the change order.
Finally grabbed a single item that was in the records table in the change order that contained a string value in the ECO comments field.
Name: Rain Cover ID: 238994
The following code should have produced a single AssocPropItem instance.
AssocPropItem[] props = WSM.ChangeOrderService.GetChangeOrderAssociationProperties(new long[] { 210262 }, new long[] { 104 }, new long[] { 238994 });
produces a null. As does any combination of values I come up with. I don't think I'm doing anything wrong, however I get nothing but null as a return value.
This function does work. Thanks.
The only point of confusion was that the third paramater long[] itemListIds would be clearer if it was labeled long[] itemListMasterIds. It would also be handier if the two methods available to extract the items "referenced" by the ECO would provide said Master Id's instead of the Base Id's they do provide.