What I would like to do is retrieve all of the Field values for a specific entity and put it in a string (for logging purposes). I'm using the Self-Servicing model.
For example: I have a User Entity that has ID, Login, Name, LocationCode. I would like to retrieve the FieldName and the FieldValue from each assignable Field and put it in a single string. So the above User Entity would return the following string:
ID=24;Login=jcrede;Name=Joe Crede;LocationCode=CHISOX
Public Function GetEntityFieldValuesAsString(objEntity as Entity) as String
Dim strReturn as New StringBuilder
For Each objField as <Field> in <objEntity.Fields>
strReturn.Append(objField.Name)
strReturn.Append("=")
Try
strReturn.Append(CStr(objField.Value))
Catch
End Try
strReturn.Append(";")
Next
Return strReturn
End Function
Is there a generic way to do this for every entity? I didn't know if there's already a build in function implemented in the EntityBase for this.