Foundations Apex API Developer Reference

fferpcore.UserInformationPlugin

global class UserInformationPlugin

This class provides interfaces which are used during the running of the Apply User Information batch job.
You can create your own plugin by implementing the fferpcore.UserInformationPlugin.Work interface and creating a Plugin__mdt record which references your class.
If the class provided in the Plugin__mdt record does not exist or is not an implementation of fferpcore.UserInformationPlugin.Work then errors will be written back to the User Information Assignment records trying to use the plugin.

fferpcore.UserInformationPlugin.Work

global interface Work

An interface to be implemented to create your own plugin for the Apply User Information batch job.
You can create your own plugin by implementing the fferpcore.UserInformationPlugin.Work interface and creating a Plugin__mdt record which references your class.
If the class provided in the Plugin__mdt record does not exist or is not an implementation of fferpcore.UserInformationPlugin.Work then errors will be written back to the User Information Assignment records trying to use the plugin.

Methods

hasAccess

String hasAccess()

Returns a string to determine if the current user has access to run this plugin.

Return Value

An error message when insufficient access or null when sufficient access.

process

UserInformationPlugin.Response process(fferpcore.UserInformationPlugin.Request request)

Works over the data in the provided request to perform actions specific to this UserInformationPlugin.Work. For example, we could create/delete records based on the requests data.

Input Parameters

Name Type Description
request fferpcore.UserInformationPlugin.Request An object which contains all the data to apply and remove for each user.

Return Value

An object with errors that occurred during the running of the plugin.

fferpcore.UserInformationPlugin.Request

global interface Request

An interface which contains the data to perform work on. This is only used in the UserInformationPlugin.Work.process method.

Methods

getDataToCreateByUserId

Map<Id, Set<String>> getDataToCreateByUserId()

Return Value

A map of data to create keyed by the Salesforce User ID.

getDataToDeleteByUserId

Map<Id, Set<String>> getDataToDeleteByUserId()

Return Value

A map of data to delete keyed by the Salesforce User ID.

getAssignmentIds

Set<Id> getAssignmentIds(Id userId, String data)

Return Value

The IDs of any User Information Assignments corresponding to the given user ID and data.

fferpcore.UserInformationPlugin.Response

global interface Response

A response from the UserInformationPlugin.Work.process method which contains errors about users that occurred during the execution of the UserInformationPlugin.Work.process method.

Methods

addError

void addError(Id assignmentId, String error)

Stores an error about the provided User Information Assignment.

Input Parameters

Name Type Description
assignmentId Id The ID of the User Information Assignment to log an error about.
error String A message for the error that occured.

getErrors

List<String> getErrors(Id assignmentId)

Find and returns all logged errors for the provided User Information Assignment ID. If no errors have been logged, then null should be returned.

Input Parameters

Name Type Description
assignmentId Id The ID of the User Information Assignment to get logged errors for.

Return Value

Logged errors for the provided Salesforce User ID.

© Copyright 2009–2020 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.