3.1.1.1.2.2.1 GetCustomFieldValues
This procedure can be used to retrieve the custom field values for an object of specified type identified by its record identifier. The following are the input parameters for the procedure:
Param_ObjectRecordId: This is a 64-bit signed integer specifying the RecordId of the object of type Param_ObjectType for which the custom field values are being retrieved.
Param_ObjectType: This is of type EnumerationObjectType specifying the type of the object for which the custom field values are being requested for.
Param_addressFamily: This is of type AddressFamily specifying the address family of the object for which the custom field values are being requested.
The procedure returns two collections:
A collection of CustomFieldValue objects,
A collection of CustomFieldPartialValue
Both are two different ways of representing the custom field values.
Param_CustomFieldValueList: This consists of the of CustomFieldValue collection and specifies the custom field values associated with the object.
Param_CustomFieldPartialValueList: This consists of the collection of CustomFieldPartialValue to specify the custom field values associated with the object.
The following are the steps involved.
Initialize the collections Param_CustomFieldValueList and Param_CustomFieldPartialValueList.
Enumerate the rows that have ObjectType equal to Param_ObjectType, UsedById equal to Param_ObjectRecordId, and Af equal to Param_addressFamily.
For each row enumerated, perform the following steps:
Create a new instance of CustomFieldValue and CustomFieldPartialValue to be added to their respective collections.
Lookup the custom field row in ADM_CustomFieldsTable using the CustomFieldId field value.
If the type of the custom field that is retrieved above is Multivalued, the following steps need to be performed:
Lookup the custom field value row in ADM_CustomFieldValuesTable having the RecordId value being CustomFieldValueId.
Assign the BuiltInCustomFieldValueId to CustomFieldValue. BuiltInCustomFieldValueId.
Assign RecordId to CustomFieldValue.RecordId field.
Assign Value to CustomFieldValue.Value field.
Assign RecordId to CustomFieldPartialValue.ValueId.
If the type of the custom field that is retrieved above is Freeform, the following steps need to be performed.
Assign Value to CustomFieldValue.Value field.
Assign Value to CustomFieldPartialValue.Value field.
Assign the custom field details as given below:
Assign RecordId of the entry in ADM_CustomFieldsTable to CustomFieldValue.ParentCustomFieldRecordId.
Assign RecordId of the entry in ADM_CustomFieldsTable to CustomFieldPartialValue.ParentCustomFieldId.
Assign Type of the entry in ADM_CustomFieldsTable to CustomFieldPartialValue.ParentCustomFieldType.
Assign CustomFieldDetails.BuiltinCustomFieldNumber to CustomFieldValue.ParentCustomFieldNumber.