Start a conversation

GAM Sales Order Fails with "Unknown Error" Due to Duplicate Fulfilment Items

Symptom

A GAM (Google Ad Manager) Sales Order shows "Unknown Error - Contact your System Administrator" when submitted or refreshed. The error occurs during the integration between CloudSense Digital Fulfilment and GAM.

Additionally, clicking "Refresh from Ad Server" on the parent Fulfilment record may result in an Apex CPU time limit exceeded error.

Cause

Two issues can contribute to this error:

  1. Duplicate Fulfilment Item records: Multiple csdf__Fulfilment_Item__c records exist for the same Product Configuration on a single Fulfilment. The custom trigger CS_FulfilmentItemTrigger attempts to build a list of PC IDs from the Fulfilment Items, and when duplicate IDs are encountered, it throws System.ListException: Duplicate id in list.

  2. Excessive Geo-Targeting records: A very large number of csdf__Geo_Targeting__c records linked to the Fulfilment Items (e.g., 13,000+) can cause CPU timeout when the system processes them during a bulk refresh operation.

Resolution

Step 1: Check for duplicate Fulfilment Items

Query the Fulfilment Items for the affected Fulfilment record:

SELECT Id, Product_Configuration__c, CreatedDate,
  csdf__Fulfilment_Item_Link__c
FROM csdf__Fulfilment_Item__c
WHERE csdf__Fulfilment__c = '<FULFILMENT_ID>'
ORDER BY Product_Configuration__c

Look for multiple rows with the same Product_Configuration__c value. Each PC should have only one Fulfilment Item.

Step 2: Delete duplicate Fulfilment Items

Delete the duplicate Fulfilment Item records, keeping only one per Product Configuration. Use the CreatedDate to determine which is the original.

Step 3: Check geo-targeting record count

If the refresh is timing out, check the total geo-targeting records:

SELECT csdf__Fulfilment_Item__c, COUNT(csdf__Geo_Item__c)
FROM csdf__Geo_Targeting__c
WHERE csdf__Fulfilment_Item__c IN (<FULFILMENT_ITEM_IDS>)
GROUP BY csdf__Fulfilment_Item__c

If the total count is very high (10,000+), refreshing all Fulfilment Items at once will exceed the CPU timeout.

Step 4: Refresh Fulfilment Items individually

Instead of using the "Refresh from Ad Server" button on the parent Fulfilment (which processes all FIs at once), refresh each Fulfilment Item individually to avoid the CPU timeout.

Step 5: Resubmit the order

After cleaning up duplicates and refreshing individually, resubmit the Sales Order.

Additional Notes

  • This issue is specific to the CloudSense Digital Fulfilment (Media) module and GAM integration
  • Duplicate Fulfilment Items can be created by automation or integration logic that runs multiple times for the same PC
  • For Sales Orders with very large geo-targeting data sets, always refresh Fulfilment Items individually rather than in bulk
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments