Framework Apex API

Select a class to inspect to get started.

Api global class Api

DescriptionApi Service, Resource, and Mapping objects
AuthorsMac Anderson, Gurp Parmar

global static SObject[] deserialize(String apiService, Dom.XmlNode node)

Returns a new SObject for the given apiService {Api.Service.name} and Dom.XmlNode (must have a root element matching a Api.Resource related to the Api.Service returned by the apiName {String})

@return
SObject[]
SObject[]
apiService
String
{String} Name of the Api.Service object to find the Api.Resource and related Api.Mapping objects used to populate values on the SObject(s) based on user configurations
node
Dom.XmlNode
{Dom.XmlNode} XML node where the root element matches the apiObject configured too the Api.Service returned by the apiName {String}
global static List<SObject> get(String resourceName)

Method to get a list of SObjects based on Resource Name

@return
List<SObject>
List<SObject> List of Sobjects that are mapped from JSON
resourceName
String
String resource name
global static List<SObject> get(String resourceName,Api.ResourceConfig config)

Method to get a list of SObjects based on Resource Name with custom config object

@return
List<SObject>
List<SObject> List of Sobjects that are mapped from JSON
resourceName
String
String resource name
config
Api.ResourceConfig
Api.ResourceConfig that stores such things as uri, url and header parameters
global static Map<String,Object> getLastJSONResponse(Api.Resource resource, String httpVerb)

Get Last JSON response based on Api.Resource and the HTTP Verb that was used. This method allows dev to get old responses to pull out data needed.

@return
Map<String,Object>
Map<String,Object> serialize JSON response
resource
Api.Resource
Api.Resource
httpVerb
String
String
global static String getLastRawResponse(Api.Resource resource, String httpVerb)

Get Last Raw response based on Api.Resource and the HTTP Verb that was used. This method allows dev to get old responses to pull out data needed.

@return
String
String raw response from vendor
resource
Api.Resource
Api.Resource
httpVerb
String
String
global static Mapping getMapping(String apiResource, String apiObject, String apiField)

Returns Api.Mapping object related to the given apiService {Api.Service.name}, apiObject {Api.Resource.apiObject}, and apiField {Api.Mapping.apiField}

@return
Mapping
Api.Mapping
apiService{String} value for Api.Service.name
apiObject
String
{String} value for the Api.Resource.apiObject
apiField
String
{String} value for the Api.Mapping.apiField
global static Mapping[] getMappings(String apiResource, String apiObject)

Returns all Api.Mapping objects related to a given Api.Service found by {String} apiService, and {String} apiObject

@return
Mapping[]
Api.Mapping[]
apiService{String} value for Api.Service.name
apiObject
String
{String} value for the Api.Resource.apiObject
global static Map<String,Object> getPreviousJSONResponse(Api.Resource resource, String httpVerb, Integer position)

Get Previous JSON response based on Api.Resource and the HTTP Verb that was used. This method allows dev to get old responses to pull out data needed.

@return
Map<String,Object>
Map<String,Object> serialize JSON response
resource
Api.Resource
Api.Resource
httpVerb
String
String
position
Integer
Integer Position the JSON to pull out if the same resource has been called mulitple times
global static Resource getResource(String apiService, String targetSObject)

Returns Api.Resource object related to the given apiService {Api.Service.name}, and apiObject {Api.Resource.apiObject}

@return
Resource
Api.Resource
apiService
String
{String} value for Api.Service.name
apiObject {String} value for the Api.Resource.apiObject
global static Resource[] getResources(String apiService)

Returns Api.Resource objects related to the given apiService {Api.Service.name}, and apiObject {Api.Resource.apiObject}

@return
Resource[]
Api.Resource[]
apiService
String
{String} value for Api.Service.name
apiObject {String} value for the Api.Resource.apiObject
global static Service getService(String apiService)

@return
Service
Service
apiService
String
{String} Api.Service.name
global static ServiceConnectionConfig getServiceConnectionConfig(String serviceConnection,String name)

Return Api.ServiceConnectionConfig object based on name and connection

@return
ServiceConnectionConfig
ServiceConnectionConfig obj
serviceConnection
String
String name
name
String
String name of config value
global static ServiceConnection[] getServiceConnections(String apiService)

Returns Api.ServiceConnection objects related to the given apiService {Api.Service.name}

@return
ServiceConnection[]
Api.ServiceConnection[]
apiService
String
{String} value for Api.Service.name
global static Service[] getServices(String namespace)

@return
Service[]
Service[] list of all Api.Service objects configured in the current installed environment for a given registered app (found by {String} namespace)
global static Service[] getServices()

@return
Service[]
Service[] list of all Api.Service objects configured in the current installed environment
global static Variable[] getVariables(String apiResource)

Returns custom setting Variable objects for making outgoing calls

@return
Variable[]
List<Api.Variable> objects
apiResource
String
{String} value for Api.Resource object
global static List<SObject> post(String resourceName,SObject sObj)

Method to POST SObjects from Saleforce to remote server. Converts SObject to JSON

@return
List<SObject>
List<SObject> List of SObjects that are mapped from POST response
resourceName
String
String resource name
sObj
SObject
SObject that will be converted to JSON
global static List<SObject> post(String resourceName,SObject sObj,Api.ResourceConfig config)

Method to POST SObjects from Saleforce to remote server. Converts SObject to JSON

@return
List<SObject>
List<SObject> List of SObjects that are mapped from POST response
resourceName
String
String resource name
sObj
SObject
SObject that will be converted to JSON
config
Api.ResourceConfig
Api.ResourceConfig that stores such things as uri, url and header parameters
global static List<SObject> post(String resourceName,List<SObject> SObjects)

Method to POST SObjects from Saleforce to remote server. Converts SObject to JSON

@return
List<SObject>
List<SObject> List of SObjects that are mapped from POST response
resourceName
String
String resource name
SObjects
List<SObject>
List<SObject> that will be converted to JSON
global static List<SObject> post(String resourceName,List<SObject> SObjects,Api.ResourceConfig config)

Method to POST SObjects from Saleforce to remote server. Converts SObject to JSON

@return
List<SObject>
List<SObject> List of SObjects that are mapped from POST response
resourceName
String
String resource name
SObjects
List<SObject>
List<SObject> that will be converted to JSON
config
Api.ResourceConfig
Api.ResourceConfig that stores such things as uri, url and header parameters
global static List<SObject> put(String resourceName,SObject sObj)

Method to PUT SObjects from Saleforce to remote server. Converts SObject to JSON

@return
List<SObject>
List<SObject> List of SObjects that are mapped from PUT response
resourceName
String
String resource name
sObj
SObject
SObject that will be converted to JSON
global static List<SObject> put(String resourceName,SObject sObj,Api.ResourceConfig config)

Method to PUT SObjects from Saleforce to remote server. Converts SObject to JSON

@return
List<SObject>
List<SObject> List of SObjects that are mapped from PUT response
resourceName
String
String resource name
sObj
SObject
SObject that will be converted to JSON
config
Api.ResourceConfig
Api.ResourceConfig that stores such things as uri, url and header parameters
global static List<SObject> put(String resourceName,List<SObject> SObjects)

Method to PUT SObjects from Saleforce to remote server. Converts SObject to JSON

@return
List<SObject>
List<SObject> List of SObjects that are mapped from PUT response
resourceName
String
String resource name
SObjects
List<SObject>
List<SObject> that will be converted to JSON
global static List<SObject> put(String resourceName,List<SObject> SObjects,Api.ResourceConfig config)

Method to PUT SObjects from Saleforce to remote server. Converts SObject to JSON

@return
List<SObject>
List<SObject> List of SObjects that are mapped from PUT response
resourceName
String
String resource name
SObjects
List<SObject>
List<SObject> that will be converted to JSON
config
Api.ResourceConfig
Api.ResourceConfig that stores such things as uri, url and header parameters
global static Api.ServiceConnectionConfig setDailyCalloutLimitConfig(String apiServiceConnection,Integer dailyLimit)

Set the Daily Limit of HTTP callouts for each service connection

@return
Api.ServiceConnectionConfig
Api.ServiceConnectionConfig
apiServiceConnection
String
String
dailyLimit
Integer
Integer

ApiOauthController global class ApiOauthController

DescriptionOAuth controller class that will do the login flow using the interface
AuthorsGurp Parmar

global PageReference login(String apiConnectionName)

Login and start OAuth flow to send to vendor site

@return
PageReference
PageReference Send user to vendors login page
apiConnectionName
String
String of the connection name to use to login
global PageReference login()

Login and start OAuth flow to send to vendor site

@return
PageReference
PageReference Send user to vendors login page

Config global class Config

DescriptionPlatform configuration objects for JSON serialization/deserialization. Used to register apps and provide an easy way to export and import JSON based configurations.
AuthorsMac Anderson, Gurp Parmar

Properties

registeredApps
RegisteredApp[]
global static void clear(Object configObject)

Removes the given configuration object from Framework custom settings

configObject
Object
{Object} Instance of configuration object to remove
global static void clear(Object[] configObjects)

Removes the given configuration object from Framework custom settings

configObjects
Object[]
{Object[]} Instance of configuration object to remove
global static void clearAll()

Remove all configurations from Framework custom settings

global static String export()

Exports Fonteva configurations

@return
String
String JSON string
global static String export(Boolean prettify)

Exports Fonteva configurations

@return
String
String JSON string
prettify
Boolean
Return JSON String in "Pretty Print" format
global static void push(Object configObject)

Commit configuration objects to the database

configObject
Object
{Object} Instance of any supported configuration objects
global static void push(Object[] configObjects)

Commit configuration objects to the database

configObjects
Object[]
{Object[]} Instance of any supported configuration objects

CustomScript global class CustomScript

DescriptionCustom Script configuration class provides low-level interaction static methods and serves as an instance of a Framework Custom Script object
AuthorsMac Anderson

Properties

apexClass
String
description
String
name
String
namespace
String

DecimalUtils global class DecimalUtils

DescriptionStatic methods for working with Decimals
AuthorsMac Anderson

global static Decimal round(Decimal decimalToRound)

Returns the rounded (System.RoundingMode.Half_Up) value for the given decimal

@return
Decimal
{Decimal}
decimalToRound
Decimal
{Decimal}

Dispatcher global class Dispatcher

DescriptionDispatcher routes SObjects sent by triggered events to the appropriate Domain Apex Class for logic processing. Dispatcher also logs any non-final exception thrown as a new System Log record to assist trouble shooting and defect replication.
AuthorsMac Anderson

Properties

dispatchLog
List<Route>
global static void dispatchTrigger()

Primary method for routiung SObjects sent by Apex Triggers. <p> The syntax for calling this method from a trigger is simple <example> trigger AccountTrigger on Account (before insert...) { Fonteva.Dispatcher.dispatchTrigger(); } <p> No arguments are required because all trigger variables persist as context variables throughout the execution context of any given trigger event. Registered App, and Registered Objects are dynamically detected using various Apex Describe methods.

Domain global class Domain

DescriptionDomain model software pattern for manaing SObject logic and validation through a series of stubbed out overrideable methods
AuthorsMac Anderson

Properties

errors
ErrorFactory
records
List<SObject>
global virtual void afterDelete()

global virtual void afterInsert()

global virtual void afterUpdate(Map<Id,SObject> existingRecords)

global virtual void applyDefaults()

global virtual void beforeDelete()

global virtual void beforeInsert()

global virtual void beforeUpdate(Map<Id,SObject> existingRecords)

global Domain(List<SObject> sObjectList)

Constructor for Domain with list of SObjects that are going to be acted up

SObjectListList<SObject>
global String error(String message, SObject record)

Returns the same message that was passed in as an argument after adding the error to the errorList

@return
String
String The value of the message string passed in as an argument
message
String
Message to show to the end user that explains the nature of the error
record
SObject
SObject that caused the error
global String error(String message, SObject record, SObjectField field)

Returns the same message that was passed in as an argument after adding the error to the errorList

@return
String
String The value of the message string passed in as an argument
message
String
Message to show to the end user that explains the nature of the error
record
SObject
SObject that caused the error
field
SObjectField
SObject field that caused the error
global virtual void validate()

global virtual void validate(Map<Id,SObject> existingRecords)

Installer global class Installer

DescriptionInstaller for populating settings and defaults for the Fonteva Framework @implements Scriptable
AuthorsMac Anderson

global static void install()

Static method to install the base objects from Framework

global static void onInstall(InstallContext context)

Method to be called on installation of Framework

context
InstallContext
InstallContext

Log global class Log

DescriptionImplementation of Fonteva Framework system logs with several static methods useful for interacting with the log including creating logs, and stack trace leveling
AuthorsMac Anderson

global static String currentLog()

Returns the string value of the current diagnostic log

@return
String
String
global static void debug(String debugString)

Log ad-hoc debug statement into the diagnosticLog which can be helpful when an exception is later thrown in the script statement to trace the core problem back to the root cause

debugString
String
Content to push to the current log.
global static void debugException(Exception ex)

Creates a new System Log record containing useful debug related date including the current stack trace and all diagnostic log entries that occured before the exception was caught in an execution context

ex
Exception
Exception object to create the System Log for
global static void pop()

Pops the current level and adds a INFO level debug in the Salesforce debug log

global static void push(String apexClass, String method)

Creates new diagnostic entry for the current log

apexClass
String
String value for Apex Class name
method
String
String value for Apex Class method name

PageUtils global class PageUtils

DescriptionStatic utility methods for working with Apex Pages
AuthorsMac Anderson

global static Boolean getBooleanParam(String paramName)

Returns Id value of a page parameter

@return
Boolean
Boolean
paramName
String
Name of the page parameter to return
global static Id getIdParam(String paramName)

Returns Id value of a page parameter

@return
Id
Id
paramName
String
Name of the page parameter to return
global static String getParam(String paramName)

Returns String value of a page parameter

@return
String
String
paramName
String
Name of the page parameter to return

RegisteredApp global class RegisteredApp

DescriptionRegistered App configuration class instance and static methods
AuthorsMac Anderson

Properties

apexNamespace
String
apiServices
List<Api.Service>
bannerImageUrl
String
customScripts
List<CustomScript>
description
String
developerEmail
String
homepage
String
iconImageUrl
String
installClass
String
isEnabled
Boolean
isManaged
Boolean
isPaid
Boolean
name
String
namespace
String
owner
String
registeredObjects
List<RegisteredObject>
rollupSummaryFields
List<RollupSummaryField>
routingRules
List<RoutingRule>
settingsPages
List<SettingsPage>
shortDescription
String
global static String export(String namespace)

Exports the configuration JSON data for a given Registered App

@return
String
String JSON configurations for the given registered app in the installed org
namespace
String
The Namespace of the registered app to export configurations
global static String export(String namespace, Boolean prettify)

Exports the configuration JSON data for a given Registered App

@return
String
String JSON configurations for the given registered app in the installed org
namespace
String
The Namespace of the registered app to export configurations
prettify
Boolean
Return JSON string in "Pretty Print" format

RegisteredObject global class RegisteredObject

DescriptionRegistered Object configuration class
AuthorsMac Anderson

Properties

apexClass
String
isEnabled
Boolean
isStandard
Boolean
namespace
String
orderBy
String
salesforceId
String
sObjectName
String
soqlLimit
String
soqlOrderBy
String
triggersEnabled
Boolean

RollupSummaryField global class RollupSummaryField

DescriptionRegistered Object configuration class
AuthorsMac Anderson

Properties

childField
String
childSObject
String
configId
String
filter
String
isEnabled
Boolean
namespace
String
operation
String
Operation
Enum
parentField
String
parentSObject
String
relationshipField
String

RoutingRule global class RoutingRule

DescriptionRouting Rule configuration class
AuthorsMac Anderson

Properties

apexClass
String
configId
String
executionOrder
Integer
isEnabled
Boolean
namespace
String
sObjectName
String

SchemaService global class SchemaService

DescriptionThe SchemaService class provides built in caching for collecting various Apex Describe information on both SObjects and SObject fields.
AuthorsMac Anderson

global static DescribeSObjectResult getDescribe(SObjectType objectToken)

Returns a DescribeSObjectResult object for a given SObjectType token.

@return
DescribeSObjectResult
DescribeSObjectResult
objectToken
SObjectType
The SObjectType to return the describe result for
global static DescribeFieldResult getDescribe(SObjectField field)

Returns the DescribeFieldResult object for a given SObjectField

@return
DescribeFieldResult
DescribeFieldResult
field
SObjectField
SObjectField to describe
global static DescribeFieldResult getDescribe(String objectName, String fieldName)

Return a field describe for a given object and field by string value for each argument (objectName and fieldName)

@return
DescribeFieldResult
DescribeFieldResult
objectName
String
The api name for the SObject type that contains the field to describe
fieldName
String
The api name for the field to describe
global static DescribeFieldResult getDescribe(SObjectType objectToken, String fieldName)

Returns a DescribeFieldResult object for a given SObjectType and field name (String value)

@return
DescribeFieldResult
DescribeFieldResult
objectToken
SObjectType
SObjectType for the SObject that holds the field to return the describe result for.
fieldName
String
String value of the api name for the field to return the describe result for.
global static Map<String,SObjectField> getFieldMap(SObjectType token)

Returns a map with key of the field api name (without namespace if same as pkg) and value of the SObjectField token.

@return
Map<String,SObjectField>
Map<String,SObjectField>
token
SObjectType
SObjectType token to return the field map for.
global static SObjectField getSObjectField(SObjectType token, String fieldName)

Returns the token for a SObject field from the SObjectType 'token' and a String 'fieldName'.

@return
SObjectField
SObjectField
global static SObjectType getSObjectType(String objectName)

Returns a token for the SObjectType found by the string value of the SObject's api name.

@return
SObjectType
SObjectType
objectName
String
String value of the SObject API name

Scriptable global class Scriptable

DescriptionInterface used by CustomScripts for ad-hoc script integration of Registered Apps - displayed on the Registered Apps detail page in Mission Control
AuthorsMac Anderson

Selector global class Selector

DescriptionSelector class for enabling common SOQL queries across registered objects with built in feature detection for Person Account, and Multi-Currency orgs, adding fields for those features when called in orgs enabled for them.
AuthorsMac Anderson

Properties

fieldsToString
String
global String buildQueryStatement()

@return
String
String SOQL statement in string form
global String buildQueryStatement(String referenceFieldName)

Returns SOQL template in string form

@return
String
String
global List<SObject> getAll()

Returns all rows for the SObjectType without filter

@return
List<SObject>
List<SObject>
global virtual List<FieldSet> getFieldSets()

Returns a list of Field Sets to use as the query fields if applicable

@return
virtual
List<FieldSet>
global virtual String getOrderBy()

@return
virtual
String config.SOQL_Order_By__c or 'Name ASC' if null
global Database.QueryLocator getQueryLocator()

@return
Database.QueryLocator
Database.QueryLocator
idSetSet<Id> of record Ids
referenceFieldNameFull API name of field to use for id filter
global Database.QueryLocator getQueryLocator(Set<Id> idSet)

@return
Database.QueryLocator
Database.QueryLocator
global Database.QueryLocator getQueryLocator(Set<Id> idSet, String referenceField)

@return
Database.QueryLocator
Database.QueryLocator
idSet
Set<Id>
Id set for soql where clause
global virtual SObjectType getSObjectType()

Override to allow a no-argument constructor for an extension to this class

@return
virtual
SObjectType Primary query result SObjectType
global SObject selectById(Id value)

Returns single SObject by record Id

@return
SObject
SObject
value
Id
Id of record to return
global SObject selectById(Id value, String referenceFieldName)

Returns single SObject by Id in a custom reference field (String name)

@return
SObject
SObject
value
Id
Id of record to return
referenceFieldName
String
Full API name of the field to search for the Id (value)
global List<SObject> selectById(Set<Id> idSet)

Returns a list of SObjects for a given set of record ids

@return
List<SObject>
List<SObject>
idSet
Set<Id>
Set<Id> of record Ids
global List<SObject> selectById(Set<Id> idSet, String referenceFieldName)

Returns a list of SObjects for a given set of custom reference ids - field to filter by specified by referenceFieldName

@return
List<SObject>
List<SObject>
idSet
Set<Id>
Set<Id> custom reference Ids
referenceFieldName
String
Field to filter Ids
global SelectOption[] selectOptions()

Returns list of SelectOptions using the getAll SObject list query

@return
SelectOption[]
SelectOption[]
global SelectOption[] selectOptions(Set<Id> idSet)

Returns list of SelectOption objects using the record ids as a filter for the options returned

@return
SelectOption[]
SelectOption[]
idSet
Set<Id>
Set<Id> of record Ids
global SelectOption[] selectOptions(Set<Id> idSet, String referenceFieldName)

Returns list of SelectOption objects using the record ids as a filter for the options returned

@return
SelectOption[]
SelectOption[]
idSet
Set<Id>
Set<Id> of record Ids
referenceFieldName
String
Full API name of field to use for id filter
global Selector()

Global no-argument constructor, only valid if the class is being constructed in an extension class

global Selector(SObjectType type)

Construct from SObjectType

type
SObjectType
SObjectType
global Selector(SObjectType type, SObjectField lookupField)

Construct with a SObjectType for the primary query result object and a token for a child object lookup field to include a relationship query to the target child sobject type in the query result

type
SObjectType
SObjectType
lookupField
SObjectField
SObjectField
global Selector(SObjectType type, SObjectField lookupField, String soqlFilter)

Construct with a SObjectType for the primary query result object and a token for a child object lookup field to include a relationship query to the target child sobject type in the query result

type
SObjectType
SObjectType
lookupField
SObjectField
SObjectField
soqlFilter
String
String
global Selector(SObjectType type, List<FieldSet> fieldSets)

Construct with a SObjectType for the primary query result object and a list of field sets to use for the fields to query as opposed to the default query all fields behavior of this class

type
SObjectType
SObjectType
fieldSets
List<FieldSet>
List<FieldSet>
global Selector(SObjectType type, List<FieldSet> fieldSets, String soqlFilter)

Construct with a SObjectType for the primary query result object and a list of field sets to use for the fields to query as opposed to the default query all fields behavior of this class

type
SObjectType
SObjectType
fieldSets
List<FieldSet>
List<FieldSet>
soqlFilter
String
String
global Selector(SObjectType type, List<FieldSet> fieldSets, SObjectField lookupField)

Construct with a SObjectType for the primary query result object and a list of field sets to use for the fields to query as opposed to the default query all fields behavior of this class - as well as a SObjectField token for a related child object field that lookups to the primary query object to include a relationship query to that object (WARNING! all child fields are returned in the query result)

type
SObjectType
SObjectType
fieldSets
List<FieldSet>
List<FieldSet>
global Selector(SObjectType type, List<FieldSet> fieldSets, SObjectField lookupField, String soqlFilter)

Construct with a SObjectType for the primary query result object and a list of field sets to use for the fields to query as opposed to the default query all fields behavior of this class - as well as a SObjectField token for a related child object field that lookups to the primary query object to include a relationship query to that object (WARNING! all child fields are returned in the query result)

type
SObjectType
SObjectType
fieldSets
List<FieldSet>
List<FieldSet>
lookupField
SObjectField
SObjectField
soqlFilter
String
String

SettingsPage global class SettingsPage

DescriptionSettings_Page__c mirrored configuration class
AuthorsMac Anderson

Properties

apexClass
String
apexComponent
String
description
String
label
String
namespace
String

SetUtils global class SetUtils

DescriptionUseful static methods for working with the Set primitive data type
AuthorsMac Anderson

global static Set<Id> getIds(List<SObject> records)

Returns a set of ids containing the record ids for each SObject contained in the list of sobjects passed in as an argument

@return
Set<Id>
Set<Id> Ids for each record in the list of sobjects passed in as an argument
records
List<SObject>
List of records to return a set of ids for
global static Set<Id> getIds(List<SObject> records, String fieldName)

Returns a set of ids containing the record ids for each SObject contained in the list of sobjects passed in as an argument

@return
Set<Id>
Set<Id> Ids for each record in the list of sobjects passed in as an argument
records
List<SObject>
List of records to return a set of ids for
fieldName
String
String fieldName to extract Id from

SObjectUtils global class SObjectUtils

DescriptionStatic utility methods for working with SObjects
AuthorsMac Anderson

global static Id getIdValue(SObject sObj, String fieldName)

Returns Id value for a given SObject and fieldName (API Name)

@return
Id
Id
sObj
SObject
SObject
fieldName
String
SObjectField Api Name
global static SelectOption[] getPicklistValues(SObjectField field)

Returns List<SelectOption> for a given SObjectField

@return
SelectOption[]
List<SelectOption>
global static SObject mapObject(SObject source, SObject target)

Returns the target SObject with the values of any custom fields found on the source SObject that share the same local name (api name without a namespace prefix - if applicable)

@return
SObject
SObject Source SObject with updated valuesap
source
SObject
Source SObject to map values
target
SObject
Target SObject to update values
global static SObject mapObject(SObject source, SObject target, Boolean updateEmptyFieldsOnly)

Returns the target SObject with the values of any custom fields found on the source SObject that share the same local name (api name without a namespace prefix - if applicable)

@return
SObject
SObject Source SObject with updated valuesap
source
SObject
Source SObject to map values
target
SObject
Target SObject to update values

StringUtils global class StringUtils

DescriptionUseful static methods for working with the String primitive data type
AuthorsMac Anderson

global static String clean(String inputString)

Returns the string passed in as an argument without whitespace characters at the start or end - if the string passed into the method is null an empty string will be returned

@return
String
String Empty string if null string passed in as argument, or the string passed in as argument free of whitespace characters at the start and end of the string

Test_FrameworkHttpCalloutMock global class Test_FrameworkHttpCalloutMock

DescriptionHTTP Mock response generator that will be called from outside of this package
AuthorsGurp Parmar

global static void setFrameworkHttpCallMock(Integer code, String body, String header)

Set HTTP Mock callout that is global to allow users to mock from outside of managed package

code
Integer
Integer
body
String
String
header
String
String
global static void setFrameworkHttpCallMock(Integer code, String body)

Set HTTP Mock callout that is global to allow users to mock from outside of managed package

code
Integer
Integer
body
String
String

VendorAuthenticationService global class VendorAuthenticationService

DescriptionBase virtual class that all vendor classes will extend for Auth functionality Such as OAuth
AuthorsGurp Parmar

Properties

AuthType
enum
global virtual String buildAuthHeader( String url, String method, Map<String,String> signatureParams, String secret)

Build Auth Header that depends on Vendor for OAuth. Some vendors do not require this

@return
virtual
String auth header
url
String
String
otherHeaderParamsMap<String,String>
global virtual String buildAuthorizationCodeUrl(Map<String,String> parameters)

Build the Authorization code url which is the final step in the Oauth flow to get the token.

@return
virtual
String HTTP URL that will be called to get token
code String code that was received from the first call in Oauth
global virtual PageReference buildTokenUrl()

Build PageReference object that will redirect you to vendor. Each vendor does this differently so the token URL needs to build by vendor class.

@return
virtual
String redirect URL used for Oauth login flow
global virtual String extractAccessToken(String messageBody)

Extract Token from Vendor response. Needs to be overriden as every Vendor sends a different response

@return
virtual
String Extracted Access Token
messageBody
String
String containing response from Vendor
global AuthType getApiAuthType()

Get the currently set AuthType for the particular vendor

@return
AuthType
AuthType Enum value
global virtual Api.ServiceConnection getApiServiceConnection()

Get the associated Api.ServiceConnection object that contains the connection info

@return
virtual
Api.ServiceConnection object
global String getAuthCodeUrl()

Get Base Oauth Authorization code url set by Vendor

@return
String
String base Oauth authorization code url
global static List<AuthConfig> getAuthConfig(VendorAuthenticationService.AuthType authType)

Get Auth Config objects for a particular Auth Type. Will return list of instantiated config objects that implement the same interface

@return
List<AuthConfig>
List<AuthConfig> List of configs
authType
VendorAuthenticationService.AuthType
VendorAuthenticationService.AuthType
global static List<VendorAuthenticationService.AuthType> getAuthTypes()

Get list of all auth types that are available in the system.

@return
List<VendorAuthenticationService.AuthType>
List<VendorAuthenticationService.AuthType> List of based on Auth type ENUM
global String getHttpMethodGetToken()

Get Base Oauth token HTTP method to get token which is set by Vendor

@return
String
String HTTP method to call to get token
global String getRedirectUrl()

Get Redirect URL that will be used by vendor to call back

Stringredirect url
global String getRefreshTokenUrl()

Get Base Oauth refresh token url set by Vendor

@return
String
String base Oauth refresh token url
global String getTokenUrl()

Get Base Oauth token url set by Vendor

@return
String
String base Oauth token url
global void setApiAuthType(VendorAuthenticationService.AuthType apiAuthType)

Set the Auth Type for the vendor

authTypeAuthType ENUM Value
global void setApiServiceConnection(Api.ServiceConnection apiServiceConnectionObj)

Set the Api.ServiceConnection object that is needed for methods to figure out what endpoint to call

apiServiceConnectionObj
Api.ServiceConnection
Api.ServiceConnection
global void setAuthCodeUrl(String url)

Set the base Oauth get authorization URL as that differs from Vendor to Vendor

url
String
Templated url that will be called to get token
global void setFailureLoginRedirect(PageReference failurePage)

Set the PageReference object that is needed for redirect

failurePage
PageReference
PageReference
global void setHttpMethodGetToken(String httpMethod)

Set HTTP method to get Token, this differs from Vendor to Vendor.

httpMethod
String
String method GET or POST
global void setRefreshTokenUrl(String url)

Set the base Oauth get refresh token URL as that differs from Vendor to Vendor

url
String
Templated url that will be called to get refresh token
global void setSuccessfulLoginRedirect(PageReference successPage)

Set the PageReference object that is needed for redirect

successPage
PageReference
PageReference
global void setTokenUrl(String url)

Set the base Oauth get token URL as that differs from Vendor to Vendor

url
String
Templated url that will be called to start Oauth login flow
global VendorAuthenticationService(Api.ServiceConnection serviceConnection)

Consturcutor that takes in the Api.ServiceConnection object on creation

serviceApi.ServiceConnection object
global VendorAuthenticationService()

Default constructor with no parameters

ResourceConfig global class ResourceConfig

DescriptionApi.ResourceConfig top-level object for configuration of new Api resource network calls
AuthorsGurp Parmar

global ResourceConfig()

Constructor that will setup some base information such as parameters, uri parameters, headers

global ResourceConfig(Map<String,String> parameters,List<String> uriParameters,Map<String,String> headers)

Constructor that will setup some base information such as parameters, uri parameters, headers

global void setCheckForExistingRecords(Boolean checkForExistingRecords)

Set the check for existing records or bypass that

checkForExistingRecords
Boolean
Boolean
global void setHeaders(Map<String,String> headers)

Set Headers Map that will be used for network calls

headers
String>
Map<String,String> key/value pairs of parameters
global void setParameters(Map<String,String> parameters)

Set Parameters map for URL calls

parameters
String>
Map<String,String> of GET/POST parameters
global void setRawResponseOnly(Boolean rawResponseOnly)

Set so that the raw response is saved and no mapping is done

rawResponseOnly
Boolean
Boolean
global void setServiceConnection(String serviceConnection)

Set the Service Connection the user would like to use for the outgoing calls

serviceConnection
String
String name of service connection
global void setUriParameters(List<String> uriParameters)

Set list of URI parameters that will be filled into the URL

uriParameters
List<String>
List<String>

ServiceConnectionConfig global class ServiceConnectionConfig

DescriptionMultiple configuration values such as scope etc for OAuth calls.
Authors

Properties

apiServiceConnection
String
configId
string
name
String
value
String

ServiceConnection global class ServiceConnection

DescriptionService connection class that stores multiple connections tied to a single Service
AuthorsGurp Parmar

Properties

accessToken
String
apiService
String
clientId
String
clientSecret
String
configId
String
configs
List<ServiceConnectionConfig>
isDefault
Boolean
password
String
refreshToken
String
scope
String
username
String

Service global class Service

DescriptionApi.Service top-level object for configuration of new Api integrations
AuthorsMac Anderson

Properties

apexClass
String
authType
VendorAuthenticationService.AuthType
connections
List<ServiceConnection>
debugMode
Boolean
description
String
displayName
String
endpoint
String
imagePath
String
isEnabled
Boolean
name
String
namespace
String
resources
List<Resource>

Resource global class Resource

DescriptionApi.Resource contains all Api.Mappings related to a given response object
AuthorsMac Anderson

Properties

apiObject
String
apiObjectKeyField
String
apiService
String
configId
String
createURI
String
createVerb
String
deleteURI
String
deleteVerb
String
mappings
List<Mapping>
readURI
String
readVerb
String
targetObjectKeyField
String
targetSObject
String
updateURI
String
updateVerb
String
variables
List<Variable>

Mapping global class Mapping

DescriptionApi.Mapping individual api fields mapped to SObjectFields for a given Api.Service and Api.Resource
AuthorsMac Anderson

Properties

apiField
String
apiObject
String
apiResource
String
apiService
String
configId
String
relatedObjectField
String
targetField
String
targetFieldType
String

Variable global class Variable

DescriptionApi.Variable that maps to outgoing request variable such as GET variables. Ability to set if field has default value and if it is required
AuthorsGurp Parmar

Properties

apiResource
String
configId
String
defaultValue
String
deserializeMapping
Map<String,String>
fieldApiName
String
fieldApiValue
String
required
Boolean
serializeMapping
Map<String,String>

Route global class Route

DescriptionClass to route dispatched action such as Trigger execution
AuthorsMac Anderson

Properties

dispatchedClass
Type
order
Integer
sobjectToken
SobjectType

DomainConstructor global class DomainConstructor

Description
Authors

Domain construct(List<SObject> sObjectList)

DynamicComponent global class DynamicComponent

DescriptionInterface for providing the ApexPages.Component to draw for Framework's dynamic Settings Pages @since 2.1.0
AuthorsMac Anderson

AuthConfig global class AuthConfig

DescriptionAuthConfig Inteface that allows us to list configs needed for OAuth or other authentication mechanisms
AuthorsGurp Parmar

String getDefaultValue()

Get the default value if it exists, if not a null value is returned

@return
getDefaultValue()
String
String getName()

Get the name of the config that will be stored as the name of Api.ServiceConnectionConfig

@return
getName()
String name
String getType()

Get the type of the config such as STRING,URL etc

@return
getType()
String type
Boolean isRequired()

Check to see if the configuration is required to make the authentication be successful

@return
isRequired()
Boolean