AccountingFieldMapping defines how Subledger carries source-object field values into ledger entries. Each component associates a field mapping with an AccountingModelConfig record and identifies a destination field on the Transaction Journal record.
This component defines the mapping, not the source or destination field itself. Its mappingBehavior setting also affects the journal-entry lifecycle: CurrentValue can cause Subledger to reverse and replace entries, rather than update an existing entry in place.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The metadata component's identity, inherited from Metadata. This is separate from the associated accounting model record's identity. |
masterLabel |
Required. The user-friendly name of the mapping. |
accountingModelConfig |
Required. Documented as the record ID of the associated AccountingModelConfig record. The example uses a name-like value, leaving serialization ambiguous. |
sourceField |
The API name of the source-object field whose value is mapped. This element can reference a CustomField component. |
targetField |
Required. The API name of the destination field on Transaction Journal. This element can reference a CustomField component. |
mappingBehavior |
Required. Accepts PointInTime or CurrentValue. The former maps the value at entry creation; the latter can trigger reversal and replacement when the mapped value differs from the source value. |
isProtected |
Indicates whether the component is protected. Accepts true or false; the default is false. |
Behavior and Constraints
The two mappingBehavior values have different accounting consequences:
-
PointInTimemaps the source value when the journal entry is created. -
CurrentValuecauses Subledger to reverse and replace journal entries whose mapped value differs from the value insourceField. It is not an in-place refresh of an existing entry.
Read the creation-time mapping rule together with the CurrentValue rule. Mapping occurs when an entry is created, but CurrentValue can also affect existing entries through reversal and replacement. It does not merely change the value copied into future entries.
isForAllocationType, isForPaymentType, and isForTransactionType are reserved for internal use. They are not documented administrative controls for selecting which transaction categories receive the mapping. Their presence with true values in the example does not make those values requirements or defaults.
The mapping's fullName and masterLabel identify and label the mapping itself. Neither identifies the associated AccountingModelConfig record.
Deployment and Retrieval
AccountingFieldMapping components use the .accountingFieldMapping suffix and are stored in the accountingFieldMappings folder.
In package.xml, use AccountingFieldMapping as the type name and the component name as the member. For example, the documented component FieldMappingOne is selected with a member of FieldMappingOne. The type also supports the wildcard character * in the manifest.
Deployment scope can include the actual source and target field definitions: both sourceField and targetField can reference CustomField components. These references identify the fields involved in the mapping; they do not define those fields.
The association supplied in accountingModelConfig needs separate attention for cross-org deployment. It is documented as a record ID, while the example contains ModelConfigOne. The example does not establish that a developer name can be substituted for a record ID.
Relationships
The mapping connects source and Transaction Journal fields and associates that mapping with an AccountingModelConfig record through accountingModelConfig. That record association is separate from the mapping component's metadata identity.
References
-
CustomField:sourceField,targetField.
Documentation Inconsistencies
The definition of accountingModelConfig says it contains the record ID of the associated AccountingModelConfig record, but the XML example uses the name-like value ModelConfigOne. This leaves the serialized value ambiguous. The example alone does not demonstrate that a developer name is interchangeable with a record ID during cross-org deployment.
Common Questions
Does CurrentValue update an existing journal entry in place?
No. With mappingBehavior set to CurrentValue, Subledger reverses and replaces journal entries whose mapped value differs from the source value. PointInTime maps the value when the entry is created.
Where are AccountingFieldMapping components stored?
They are stored in the accountingFieldMappings folder with the .accountingFieldMapping suffix. The manifest type name is AccountingFieldMapping, and wildcard selection is supported.
Can accountingModelConfig contain a developer name instead of a record ID?
The documentation does not resolve that question. The element is defined as a record ID, but the example uses ModelConfigOne. That example does not establish developer-name interchangeability for cross-org deployment.
Can I use the isForTransactionType flag to choose which transactions receive a mapping?
It is not a documented administrative control for that purpose. isForTransactionType, isForPaymentType, and isForAllocationType are reserved for internal use.
Which field definitions are related to an AccountingFieldMapping?
sourceField identifies the source-object field, and targetField identifies the destination field on Transaction Journal. Both can reference CustomField components, so those field definitions matter to deployment scope and mapping impact.