3B Portals & Mobile App version 1.23 changelog

From 3B Knowledge
Jump to navigation Jump to search

Changes

We are making some changes in the communication protocols that run the Portals & Mobile apps application. Until this update, it could be hard to develop custom apex code for 3B Portals applications. We are now introducing a change that removes the need to use the b3p.GlobalRemotingRouter class. This change is necessary as we have multiple namespaces (b3p, b3s, b3v, b3d, & b3f), so in order to make things easier, now namespaces don't matter when making a custom apex class callout.

The new Portal Communication Architecture

Classes that need to be called from the portal custom components no longer need to use the b3p.GlobalRemotingInterface interface, instead they should rely solely on the system class "System.Callable"

//Old Format
public with sharing class CustomClass implements b3p.GlobalRemotingInterface{
    ...
}
//New Format
public with sharing class CustomClass implements System.Callable {
    ...
}

Then, simply implement a call method like so:

public static Object call(String action, Map<String, Object> args) {
        switch on action {
            when 'someAction' {
                return upsertRecords(
                    (String) args.get('param1'), 
                    (String) args.get('param2'));
            }
            when else {
                return new ErrorResponse(
                    String.format(
                        'Invalid Paraeter for class {0} and action {1}',
                        new List<Object>{ 'This class', action }
                    )
                );
            }
        }
    }

1.23 - 1.24 - deprecated

1.25 Link: https://login.salesforce.com/packaging/installPackage.apexp?p0=04tWS000000Mjph