Start a conversation

Sales Order Page Fails with "Remoting Response Size Exceeded Maximum of 15 MB"

Symptom

When opening a Sales Order page, a JavaScript alert immediately appears:

Remoting response size exceeded maximum of 15 MB

The Sales Order UI fails to load, preventing the user from viewing line items or managing the order. This is a Salesforce platform hard limit on Visualforce remoting response size.

Cause

The Sales Order page loads all csmso__Node_Advert_Assignment__c records during initialization. When the volume of these records (combined with the configured fields) exceeds 15 MB, the Salesforce remoting response hits the platform limit.

The fields included in the query are configured via the custom setting:
csmso__SalesOrderAPI__ccsmso__Node_Advert_Assignment_Fields__c

Both the number of records and the number of fields contribute to the payload size. Production and sandbox environments may behave differently if their data volumes are not identical.

Resolution

Step 1: Check the current record count

SELECT COUNT(Id)
FROM csmso__Node_Advert_Assignment__c

If this returns more than ~20,000 records, the 15 MB limit may be triggered depending on the number of fields configured.

Step 2: Review the configured fields

SELECT Id, csmso__Node_Advert_Assignment_Fields__c
FROM csmso__SalesOrderAPI__c

Review the list of fields. Identify any that are not actively used and can be removed to reduce the payload size.

Step 3: Clean up unused records

Delete any csmso__Node_Advert_Assignment__c records that are no longer needed (e.g., expired assignments, orphaned records, or records for inactive products). This is the preferred approach over removing fields.

Step 4: Verify the fix

After cleaning up records or reducing fields, reopen the Sales Order page and confirm it loads without the 15 MB error.

Step 5: Monitor production risk

If your sandbox hit this limit, check whether production has a similar record count:

SELECT COUNT(Id)
FROM csmso__Node_Advert_Assignment__c

If production volumes are close to sandbox volumes, the same issue may occur there as data grows.

Additional Notes

  • The 15 MB limit is a Salesforce platform hard limit for Visualforce remoting responses and cannot be increased
  • Both record count and field count contribute to payload size -- reducing either helps
  • Consider implementing a periodic cleanup process for csmso__Node_Advert_Assignment__c records to prevent this issue from recurring
  • After fields are removed from the custom setting, existing data in those fields remains in the database but is no longer queried, immediately reducing payload size
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments