Showing results for 
Search instead for 
Did you mean: 

How to find value of PropertyDescriptor using SOA API ?


Within the field 'SoaType' of a Form there is a subfield 'PropDescs' which contains the names of fields on the form, but not the values.


For ex. the field 'owning_group' contains the key 'owning_group' and the value '{Teamcenter.Soa.Internal.Client.Model.PropertyDescriptionImpl}', not the string containing the owning_group's name.


Rather the value exposes the PropertyDescription type members, ex. 'enabled, FieldType, InitialValue, Localizable, LovCategory' to name a few, but again, the actual value within the field is not present/or loaded.


Running DataManagementService.GetProperties on the WorkspaceObject representing the Form is not loading any additional properties, namely, Object_properties which appears to be the field desired in this case.


GetAttachedPropDescs2 documentation wording isn't providing clarity - "Get the attached property descriptor based on input type name and property names structure."


Is this meaning it takes an input type, ex. "ItemRevision", and ex. name "object_name", that the output would be "String" or the actual value stored in object_name?


Similarly, how does this method know which object to pull the data from?


tl;dr - How to load the entered value for a given field on a form and retrieve it?


Re: How to find value of PropertyDescriptor using SOA API ?


ModelObject.GetProperty(string propertyName) returns an 'Properpty' object which contains the data in a variety of parameters. 'DisplayValue', 'StringValue', et cetera.


Edit: to include an example.


Note: this returns custom properties created via the BMIDE as well, at least, for me.


// Load the property
Teamcenter.Soa.Client.Model.Property temp = ModelObject.GetProperty("owning_user");

// Data entered into "owning_user" field
string refFormText = temp.StringValue;