Skip to content

Note

This flow is self-documenting and should be viewed within Salesforce (Setup > Process Automations > Flows). This document is to support working through a visual flow. The flow commentary in this document was generated with AI assistance.

Overview#

Flow name: MoveData_Commerce_Order_Item_Duplicate Label: [MoveData] Commerce: Order Item - Record Match Type: Auto-Launched Flow Template API version: 56.0 Status: Active

This flow performs duplicate detection for commerce order item records by using platform keys to identify existing opportunity line items in Salesforce. It includes configurable filtering to exclude specific item types such as platform fees.

Purpose#

The flow attempts to find an existing OpportunityLineItem record for an order item to support update operations. It performs a matching strategy including:

  • Match against platform key using the Platform_Key__c field on OpportunityLineItem records
  • Optional exclusion of platform fee items based on configuration settings
  • Reliable order item deduplication during commerce transaction processing

Salesforce fields#

Field API name Field type Purpose in flow
OpportunityLineItem.Platform_Key__c Text Platform key for direct line item matching
OpportunityLineItem.Id ID Line item record identifier returned as result

Input variables#

Core matching data#

Variable Type Required Description
PlatformKey String No Generated platform key for direct line item lookup
Catalog_Type String No Item type for exclusion filtering

Configuration variables#

Variable Type Default Description
Config_OrderExcludeFeePlatform Boolean false Exclude platform fee items from processing

Output variables#

Variable Type Description
Result String Salesforce Record ID of matching line item (if found)
Continue Boolean Flag indicating whether processing should continue

Flow logic#

1. Type-based filtering#

The flow first evaluates whether to skip processing based on item type:

Skip platform fee logic:

  • Condition: Config_OrderExcludeFeePlatform = true AND Catalog_Type = "feePlatform"
  • Action: Sets Continue = true and terminates processing
  • Purpose: Excludes platform fee items when configured

2. Platform key direct matching#

If processing continues, the flow attempts platform key matching:

  • Condition: Platform key is provided
  • Action: Query OpportunityLineItem records where Platform_Key__c equals the provided platform key
  • Result: Returns matching line item ID if found

Error handling#

Missing data scenarios#

  • No platform key: Flow terminates without performing lookup
  • Platform fee exclusion: Flow sets Continue flag and terminates when configured to exclude fee items
  • No match found: Result remains null, indicating new record should be created

Data quality validation#

  • Null values: Graceful handling of missing platform key parameter
  • Query failures: Uses assignNullValuesIfNoRecordsFound for robust error handling
  • Configuration control: Respects exclusion settings for specific item types

Dependencies#

None

Ask MoveData AI
Ask about setup, configuration, or troubleshooting
How can I help you with MoveData today?