[ This file is autogenerated from apexdoc ]
AqTypeConverter
Handles type conversion between JSON values and Salesforce field types. Automatically converts values from JSON format to the appropriate Salesforce field type.
Group modules/mapping tool
Overview
AqTypeConverter provides static methods for converting JSON values (String, Number, Boolean) to Salesforce field types. It handles automatic type conversion during JSON to SObject parsing operations.
Supported Conversions
From String:
- Text/Email/Phone/URL: Direct assignment
- Number/Currency/Percent: Parsed as Decimal
- Date: Parsed from ISO format (YYYY-MM-DD)
- DateTime: Parsed from ISO format
- Boolean: "true"/"false" converted to Boolean
- Picklist: Direct assignment (must match valid picklist value)
- Multi-Select Picklist: Semicolon-separated values
From Number:
- Number/Currency/Percent: Direct assignment
- Boolean: 1 converts to true, 0 converts to false
From Boolean:
- Boolean: Direct assignment
Not Supported:
- Files (BASE64BINARY): Throws exception
List<Object>: Throws exception
Usage
This class is primarily used internally by AqJsonToSobjectParser during JSON parsing operations. It can also be used directly for custom type conversion needs.
See the main module documentation for complete type conversion details.
Fields
public ERROR_MESSAGE_INCORRECT_FIELD_DEFINITION → String
public ERROR_MESSAGE_ERROR_CONVERTING_VALUE → String
public ERROR_MESSAGE_INVALID_DATA_TYPE → String
public ERROR_MESSAGE_FILES_NOT_SUPPORTED → String
public ERROR_MESSAGE_INVALID_VALUE → String
Methods
public static Object convertValueToFieldType(Object fieldValueObject, String objectName, string fieldName)
Classes
AqTypeConverterException
Inheritance
AqTypeConverterException