General debug setting

It is our goal to support developers with all required information to implement perfarmant pricing. Sfix is offering quite detailed debugging information, configure following CPQ setting to get ALL debug info:

  • [optional] SfixLog: True

Get from us Sfix wrapper classes with following section (or copy-paste it from here):

SfixLogWrapper.printDebugLog();

SfixLogWrapper.cls

global with sharing class SfixLogWrapper {
    global static void printDebugLog(){        
        Callable callableClass = (Callable)Type.forName('sfix', 'DebugLogger').newInstance();
        printDebugLog( (List<Map<Datetime,String>>)callableClass.call('getLog',null) );
    }

    @TestVisible
    private static void printDebugLog( List<Map<Datetime,String>> log ){        
        if( log!=null && log.size()>0 ){
            for( Map<Datetime,Object> logEntry : log )
                for( Datetime key : logEntry.keySet() )
                    System.debug( key.format('hh:mm:ss.SSS') + ' ' + logEntry.get(key) );
            log.clear();
        }
        else
            System.debug( '🍁 no pricing plan debug' );
    }  
}

This class will output sfix debug info in regular Salesforce log (turn on Salesforce debug logs in Setup).

Caution: in case you have several pricing plan steps and large number of line items, log can be quite big and exceed maximum allowed heap size.

Specific debug setting

When you want to debug just a single, concrete pricing plan step, add SfixLog parameter (make sure to clear CPQ cache afterwords): Debug Log

Implement system debugs as described in previous point, and turn on Salesforce debug logs. You can activate debug for multiple steps, whenever it is required.