- Available Since API Version – 2.4\
AttributeField fields are schema-less fields that are used to encapsulate a variety of information about Maximizer entities.
Because AttributeField fields do not have a fixed schema, their structure may vary from one object to another, depending on the context.
In order to determine the structure of an AttributeField for a field of a given object, it is necessary to inspect the object that is returned in a read request for that field.
AttributeField fields may only be requested via their default value:
- Value An object containing the attributes for the entity.\
Read Request
The following example illustrates the syntax for a request for the default value of an AttributeField field in a Read method call.
The examples below show requests and responses for the "Attributes" field of a variety of field types requested via the SchemaRead method. Note that the syntax in the Request is the same for all field types; however, the syntax of the response varies depending on the type of field.
The highlighted sections in the Requests and Responses below show the Attributes field syntax for the field.
Request (EnumField)
{
"Schema":{
"Scope":{
"Fields":{
"Key":1,
"Attributes":1
}
},
"Criteria":{
"SearchQuery":{
"$AND":[
{
"AppliesTo":{
"$IN":[
"AbEntry"
]
}
},
{
"Name":{
"$EQ":"Category"
}
}
]
}
}
}
}
Response (EnumField)
{
"Code": 0,
"Schema": {
"Data": [
{
"Key": "Category",
"Attributes": {
"MultiSelect": true,
"YesNo": false
}
}
]
}
}
Request (DateTimeField)
{
"Schema":{
"Scope":{
"Fields":{
"Key":1,
"Attributes":1
}
},
"Criteria":{
"SearchQuery":{
"$AND":[
{
"AppliesTo":{
"$IN":[
"AbEntry"
]
}
},
{
"Name":{
"$EQ":"Date Last Contacted"
}
}
]
}
}
}
}
Response (DateTimeField)
{
"Code":0,
"Schema":{
"Data":[
{
"Key":"LastContactDate",
"Attributes":{
"Date":true,
"Time":false,
"IgnoreYear":false
}
}
]
}
}
Request (StringField)
{
"Schema":{
"Scope":{
"Fields":{
"Key":1,
"Attributes":1
}
},
"Criteria":{
"SearchQuery":{
"$AND":[
{
"AppliesTo":{
"$IN":[
"AbEntry"
]
}
},
{
"Name":{
"$EQ":"Web Site"
}
}
]
}
}
}
}
Response (StringField)
{
"Code":0,
"Schema":{
"Data":[
{
"Key":"WebSite",
"Attributes":{
"MaxLength":255,
"Encrypted":false
}
}
]
}
}
Request (DurationField)
{
"Schema":{
"Scope":{
"Fields":{
"Key":1,
"Attributes":1
}
},
"Criteria":{
"SearchQuery":{
"$AND":[
{
"AppliesTo":{
"$IN":[
"AbEntry"
]
}
},
{
"Name":{
"$EQ":"Days to Contract Start"
}
}
]
}
}
}
}
Response (DurationField)
{
"Code": 0,
"Schema": {
"Data": [
{
"Key": "Udf/$TYPEID(21)",
"Attributes": {
"Precission": "Days",
"Anchor": "/AbEntry/Udf/$TYPEID(20)",
"Rounding": "Actual",
"Format": "D"
}
}
]
}
}
Request (NumericField)
{
"Schema":{
"Scope":{
"Fields":{
"Key":1,
"Attributes":1
}
},
"Criteria":{
"SearchQuery":{
"$AND":[
{
"AppliesTo":{
"$IN":[
"AbEntry"
]
}
},
{
"Name":{
"$EQ":"Category Formula"
}
}
]
}
}
}
}
Response (NumericField)
{
"Code":0,
"Schema":{
"Data":[
{
"Key":"Udf/$TYPEID(24)",
"Attributes":{
"MinValue":null,
"MaxValue":null,
"DecimalPlaces":0
}
}
]
}
}
Request (CurrencyField)
{
"Schema":{
"Scope":{
"Fields":{
"Key":1,
"Attributes":1
}
},
"Criteria":{
"SearchQuery":{
"$AND":[
{
"AppliesTo":{
"$IN":[
"AbEntry"
]
}
},
{
"Name":{
"$EQ":"Forecast Revenue"
}
}
]
}
}
}
}
Response (CurrencyField)
{
"Code":0,
"Schema":{
"Data":[
{
"Key":"Udf/$TYPEID(19)",
"Attributes":{
"MinValue":null,
"MaxValue":null,
"DecimalPlaces":2
}
}
]
}
}
Request (BooleanField)
{
"Schema":{
"Scope":{
"Fields":{
"Key":1,
"Attributes":1
}
},
"Criteria":{
"SearchQuery":{
"$AND":[
{
"AppliesTo":{
"$IN":[
"AbEntry"
]
}
},
{
"Name":{
"$EQ":"Starred Entry"
}
}
]
}
}
}
}
Response (BooleanField)
{
"Code":0,
"Schema":{
"Data":[
{
"Key":"Lead",
"Attributes":{
"True":{
"DisplayValue":"Yes"
},
"False":{
"DisplayValue":"No"
}
}
}
]
}
}
Create/Update Request
The following example illustrates the syntax for including an AttributeField in a Create or Update method call.
If the Attributes property is included in the request when creating or updating a field, it should have the appropriate properties given the field Type being created/updated, as shown above.
When creating or updating a field, any Attributes properties that are not valid for the field Type will be ignored.
When creating a field, if any Attributes properties for the specified field Type are missing from the request, they will take the default values for the field type.
The example below shows a request and response for the "Attributes" field of a numeric user-defined field requested via the SchemaCreate or SchemaUpdate methods.
Request
{
"Schema":{
"Data":{
"Key":null,
"Type":"EnumField<StringItem>",
"AppliesTo":[
"Opportunity"
],
"Name":"My New Table UDF",
"Attributes":{
"MultiSelect":true
}
}
}
}
Response
{
"Code": 0,
"Schema":{
"Data":{
"Key":"Udf/$TYPEID(45)",
"Type":"EnumField<StringItem>",
"AppliesTo":[
"Opportunity"
],
"Name":"My New Table UDF",
"Attributes":{
"MultiSelect":true,
"YesNo":false
}
}
}
}