Community
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
Solved! Go to Solution.
Solved by Markus.Koechl. Go to Solution.
The entity class id for Change Order is "CO"; you need to change "CUSTENT_CHANGEORDER" to "CO".
Can't find what you're looking for? Ask the community or share your knowledge.