I need to create several UDPs and then set the values for each one.
I don’t understand how to use AddPropertyDefinition. I can’t figure out how to get what I need to pass in the entityClassCtntSrcPropDefs parameter. Anyone have an example of the correct usage of AddPropertyDefinition and how to get all the required inputs?
Also having problems setting the value of an existing UDP. I keep getting a SoapException # 1013. What does this mean?
Thanks
Figured it out.
FYI,
For unmapped properties passing null for the entityClassCtntSrcPropDefs parameter.
UpdateFileProperties take the MasterID of the file, not fileID.
I recommend using the Vault Explorer client, if possible, for setting up UDPs.
Why is that? Are there certain things I should be doing or not doing when setting up the UDPs?
My plan is to have several UDPs in place so they can be set later based on information in Inventor files. This initial creation would be a one time setup by a user with the appropriate permissions.
While we're on the topic of setting UDPs I had a couple questions and can't find answers in either examples or docs...
1) the UpdateItemProperties function takes three parameters, the first being itemRevIds. Is this an array of file and/or folder IDs?
2) I'm assuming all 3 arrays (itemREvIds, propDefIds, and values) are all the same size, true?
3) It it acceptable to use ArrayLists instead of arrays?
4) In the docs it says "The Item needs to be in an editable state prior to calling this function". Does this simply mean not checked out, or are there other things one needs to do to get it into an editable state?
5) Following up in #4, what's the recommended way to lock the item prior to updating properties?
Thanks for any suggestions. The good news is that this is the last big nut to crack on this particular project. 🙂
Dan
The reason I recommened using Vault Explorer for creating UDP definitions is because it's easier. If you are only doing a one time creation, then it's easiest to just use the UI. But in cases where the UDP is getting added over and over again or you have a large set of UDP definitions, then the API is the way to go.
If you want to edit a file UDP value, you need to call DocumentService.UpdateFileProperties(...). The ItemService relates to the Item feature in Vault Professional.
No you can't pass in the ArrayList. I personally prefer the List<> class over array list because it is type-safe, you aren't constantly converting from Object. Also List<> has a ToArray function that easily converts it to an array.
I want to generate mapped UDP’s by API and I don’t understand how the AddPropertyDefinition works.
I can list all the property definition values from existing mapped properties searching through theProperty.EntClassCtntSrcPropCfg array and also store these values in a newProperty.EntClassCtntSrcPropCfg and generate a new UDP with this values.
The AddPropertyDefinition asks for an entityClassCtntSrcPropDefs() as EntClassCtntSrcPropCfg.
How to declare and fill a new entityClassCtntSrcPropDefs() array for a new mapped UDP?
Thanks in advance.