Start a conversation

DynamicGroupApi Does Not Support Product List Filtering

Symptom

When calling csfamext.DynamicGroupApi.getProductsFromFrameAgreement(String faId), the API returns all products matching the frame agreement's filter criteria. There is no method signature that accepts a product list parameter to restrict the returned set to specific products.

Cause

The DynamicGroupApi class exposes only one public method: getProductsFromFrameAgreement(String faId). This method uses the frame agreement's attachment to determine filter criteria and pricing, and always returns the complete set of matching products. There is no overloaded version that accepts a product ID list.

Resolution

Workaround: Filter client-side after the API call

Since the API always returns the full product set, filter the results in your custom code after the call:

  1. Call getProductsFromFrameAgreement(faId) once to retrieve all products with pricing
  2. In your custom Apex or client-side code, filter the returned list by your target product IDs (e.g., by CommercialProductOnDynamicGroup.Id)
// Example: Filter to specific products after API call
List<Object> allProducts = csfamext.DynamicGroupApi.getProductsFromFrameAgreement(faId);
Set<Id> targetProductIds = new Set<Id>{ /* your product IDs */ };

List<Object> filteredProducts = new List<Object>();
for (Object product : allProducts) {
    // Filter by your product IDs
    // (adapt based on the actual return type structure)
}

This approach keeps your custom API performant by avoiding multiple API calls while still returning only the products you need.

Additional Notes

  • The getProductsFromFrameAgreement method is the only entry point for retrieving products with frame agreement pricing via the Dynamic Group API
  • If filtering a large product set is a performance concern, consider caching the full result set and reusing it across multiple calls within the same transaction
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments