Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get change order user defined property by Vault Api problem

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Chiften
242 Views, 1 Reply

Get change order user defined property by Vault Api problem

hi. 

i want to get a user defined properties value of my change orders by vault api using c#.

how can i get value of a user defined properties named : Responsible discipline

 

i write this code but it doesn't work.

 

 

            foreach (var changeOrder in AllChangeOrders)
            {
                MessageBox.Show(changeOrder.Num);
                // Get the user-defined property definition for "Responsible Discipline"
                PropDef responsibleDisciplinePropDef = VaultConnection.WebServiceManager.PropertyService.GetPropertyDefinitionsByEntityClassId("CUSTENT_CHANGEORDER")
                        .FirstOrDefault(pd => pd.DispName == "Responsible Discipline");

                if (responsibleDisciplinePropDef != null)
                {
                    // Get the value of the "Responsible Discipline" property for the change order
                    PropInst responsibleDisciplinePropInst = VaultConnection.WebServiceManager.PropertyService.GetProperties("CUSTENT_CHANGEORDER", new long[] { changeOrder.Id }, new long[] { responsibleDisciplinePropDef.Id })
                        .FirstOrDefault();
                    string responsibleDisciplineValue = (string)responsibleDisciplinePropInst.Val;


                }

            }

 

please help me .

thank you

Tags (2)
Labels (1)
1 REPLY 1
Message 2 of 2
Markus.Koechl
in reply to: Chiften

The entity class id for Change Order is "CO"; you need to change "CUSTENT_CHANGEORDER" to "CO".



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report