Get change order user defined property by Vault Api problem

Get change order user defined property by Vault Api problem

Chiften
Contributor Contributor
415 Views
1 Reply
Message 1 of 2

Get change order user defined property by Vault Api problem

Chiften
Contributor
Contributor

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

0 Likes
Accepted solutions (1)
416 Views
1 Reply
Reply (1)
Message 2 of 2

Markus.Koechl
Autodesk
Autodesk
Accepted solution

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