Retrieving customize value of Record Class using GetProperty method

Hi,

We are using HPRM SDK in that we have BaseObjectTypes.Record and there are some custom properties created by the team which are not provided by HPRM. I want to access them I dont know ho to get the value of custom properties of BaseObjectTypes.Record.

Thanks,

Ashwin

 

Parents
  • Here is one way to do it...

    var fieldDefinition = new FieldDefinition(db, fieldDefinitionUri);
    
    if (fieldDefinition.IsUsedFor(record))
    {
        value = record.GetFieldValueAsString(fieldDefinition, StringDisplayType.TreeColumn, useHTMLEscapeChars: false);
    }

    If you search the doco for user defined fields (or "udf") you should be able to find some more information.

    Note in the example above that FieldDefinition is the object associated with custom properties. It is easy to get the value if you know their URIs ahead of time, otherwise you can iterate over FieldDefinitions in a similar way to Records.

Reply
  • Here is one way to do it...

    var fieldDefinition = new FieldDefinition(db, fieldDefinitionUri);
    
    if (fieldDefinition.IsUsedFor(record))
    {
        value = record.GetFieldValueAsString(fieldDefinition, StringDisplayType.TreeColumn, useHTMLEscapeChars: false);
    }

    If you search the doco for user defined fields (or "udf") you should be able to find some more information.

    Note in the example above that FieldDefinition is the object associated with custom properties. It is easy to get the value if you know their URIs ahead of time, otherwise you can iterate over FieldDefinitions in a similar way to Records.

Children