Symptom
Custom buttons and extensions implementing csbb.CustomButtonExt fail to instantiate when customer classes use Salesforce API version 49.0 or higher. This is a cross-namespace deserialization restriction introduced by Salesforce.
Cause
Salesforce API version 49.0+ introduced cross-namespace class instantiation restrictions. The JSON.deserialize() method has cross-namespace restrictions starting from API v49.0. When customer code references CSBB package classes and uses API v49+, deserialization fails.
Resolution
Step 1: Install the patch release R35-MR1 Patch 1 (35.3.1)
Install URL: /packaging/installPackage.apexp?p0=04tKA000000D2yh
This patch replaces JSON.deserialize() with Type.newInstance() in InstanceManager.deSerialize(), which does not have cross-namespace restrictions. The package API version is upgraded from v31.0 to v49.0. No customer code changes are required after installing the patch.
Why the Patch Fixes It
The internal instance manager uses JSON.deserialize() to instantiate classes by name. Starting with Salesforce API v49.0, JSON.deserialize() has cross-namespace restrictions that prevent deserializing classes from a different namespace. The R35-MR1 Patch 1 replaces JSON.deserialize() with Type.newInstance(), which does not have cross-namespace restrictions, allowing customer classes implementing csbb.CustomButtonExt to be instantiated correctly regardless of API version.
Additional Notes
- Fix for: CSBB package deserialization issues with custom classes using API 49+
- Custom buttons and extensions implementing csbb.CustomButtonExt failed to instantiate when customer classes used Salesforce API version 49.0 or higher due to cross-namespace deserialization restrictions
- Fixed by replacing JSON.deserialize() with Type.newInstance() in InstanceManager.deSerialize() method
Priyanka Bhotika
Comments