pse.APICommonsServiceglobal with sharing class APICommonsService EnumsBatchJobType
pse.APICommonsService.iBatchCallbackglobal interface iBatchCallback You can use the iBatchCallback global interface to hook into FinancialForce PSA billing processes such as: Methods
beforeStartvoid beforeStart(pse.APICommonsService.BatchContext bc) This method is called before the logic of the Start method of a batch is processed. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. global void beforeStart(pse.APICommonsService.BatchContext bc){} afterStartvoid afterStart(pse.APICommonsService.BatchContext bc) This method is called after the logic of the Start method of a batch is processed. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. global void afterStart(pse.APICommonsService.BatchContext bc){} beforeExecutevoid beforeExecute(pse.APICommonsService.BatchContext bc, set<Id> scope) This method is called before the logic of the Execute method of a batch is processed. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. global void beforeExecute(pse.APICommonsService.BatchContext bc, Set<ID> scope){} afterExecutevoid afterExecute(pse.APICommonsService.BatchContext bc, set<Id> scope) This method is called after the logic of the Execute method of a batch is processed. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. beforeFinishvoid beforeFinish(pse.APICommonsService.BatchContext bc) This method is called before the logic of the Finish method of a batch is processed. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. global void beforeFinish(pse.APICommonsService.BatchContext bc){} afterFinishvoid afterFinish(pse.APICommonsService.BatchContext bc) This method is called after the logic of the Finish method of a batch is processed. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. global void afterFinish(pse.APICommonsService.BatchContext bc){ BillingContext bbc = (BillingContext)bc; appirio_core__Config_Value__c cv = [SELECT id,appirio_core__Value__c FROM appirio_core__Config_Value__c WHERE appirio_core__Config_Option__r.Name = 'nextInvoiceNumber' ]; Integer invNum = Integer.valueOf(cv.appirio_core__Value__c); List<pse.BillingEventsManager.InvoiceInfo> invoiceInfo = new List<pse.BillingEventsManager.InvoiceInfo>(); for (ID id : bbc.ids) { pse.BillingEventsManager.InvoiceInfo ii = new pse.BillingEventsManager.InvoiceInfo(id,String.ValueOf(invNum),Date.today()); invoiceInfo.add(ii); invNum++; } cv.appirio_core__Value__c = String.ValueOf(invNum); update cv; pse.APIBillingService.Invoice(invoiceInfo); } getJobTypeBatchJobType getJobType() This method must be implemented by the creator of any class that implements the iBatchCallback interface. This indicates the FinancialForce PSA billing process that the class is to intends to implement. These FinancialForce PSA billing processes all confirm that the implemented type matches their identity: Return ValueThis method returns an APICommonsService.BatchJobType object. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. global pse.APICommonsService.BatchJobType getJobType(){return pse.APICommonsService.BatchJobType.Release;} pse.APICommonsService.BatchContextglobal inherited sharing abstract class BatchContext BatchContext contains information about the context of the job. This is specific to each process and is based on the information used to launch that process. Properties
pse.APICommonsService.BatchStatusglobal inherited sharing class BatchStatus Contains the status, error message and batch Id of a job. Properties
MethodsBatchStatusglobal BatchStatus(String status, String errorMessage, Id jobID) |