global static pse.APICommonsService.BatchStatus release(pse.APIBillingService.BillingContextRelease bc)
Validates that all billing events are in an unreleased state and executes the PSA release process for the billing events specified in the input parameters.
global static pse.APICommonsService.BatchStatus invoice(pse.APIBillingService.BillingContextInvoice bc)
Validates that all billing events specified in the input parameters are unreleased and are not invoiced and then executes the PSA invoice process for the billing events specified in the input parameters.
global static pse.APICommonsService.BatchStatus recalc(pse.APIBillingService.BillingContextRecalc bc)
Validates whether all billing events are in an unreleased state and executes the PSA recalc process for the billing events specified in the input parameters.
global static pse.APICommonsService.BatchStatus remove(pse.APIBillingService.BillingContextRemove bc)
Removes billing events using the parameters specified. This deletes unreleased billing events or billing event items belonging to unreleased billing event items depending on the input provided.
Structure containing an Id of a business record to clear billing data for and the type of object to which it belongs.
Return Value
This method returns a APICommonsService.BatchStatus object.
Sample Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//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.
staticvoidtestClear()
{
pse__Proj__c p = [SELECT id,pse__Account__c FROM pse__Proj__c WHERE name = 'Proj1'];
pse__Time_Period__c tp = [select Id, Name, pse__Start_Date__c, pse__End_Date__c from pse__Time_Period__c WHERE name = 'Perpetual'];
pse__Milestone__c m = [select id,pse__Project__c,pse__Actual_Date__c,pse__Description__c,CurrencyIsoCode,pse__Milestone_Amount__c FROM pse__Milestone__c LIMIT 1];
Id of the region, practice or group to filter billing event generation on. You can specify any combination of one regionID, one practiceID and one groupID, but at least one regionID, practiceID or groupID must be specified. Child regions, practices and groups are included automatically.
practiceID
Id
ID of the region, practice or group to filter billing event generation on. You can specify any combination of one regionID, one practiceID and one groupID, but at least one regionID, practiceID or groupID must be specified. Child regions, practices and groups are included automatically.
groupID
Id
Id of the region, practice or group to filter billing event generation on. You can specify any combination of one regionID, one practiceID and one groupID, but at least one regionID, practiceID or groupID must be specified. Child regions, practices and groups are included automatically.
timePeriodID
Id
Id of the time period to generate billing events for. If useFlexiblePeriods is true, this parameter is ignored.
accountID
Id
Id of the account to generate billing events for.
projectID
Id
Id of the project to generate billing events for.
billingCalculationID
Id
Id of the Billing Calculation record created by the generation process.
includePriorPeriods
Boolean
Determines whether billing events are to be generated for all time periods prior to and including the one in timePeriodID. When false, billing events are only generated for the time period specified in timePeriodID. If useFlexiblePeriods is true, this parameter is ignored.
useFlexiblePeriods
Boolean
Indicates whether billing events are to be generated in flexible time period mode. When in this mode, billing events are based on the cutoff date instead of a time period. Billing events are generated for time periods that end on or before the date you specify according to the time period type for which the account or project is to be billed. All business object records are grouped into billing events based on the time period types for which the account or project is to be billed.
cutoff
Date
The cut-off date on which to base project and account billing events. This parameter is ignored when useFlexiblePeriods is false. This is the latest inclusive date for which billing events are to be generated. The cut-off date is compared to the Effective Date on each region, practice, group, project and account and billing events are generated based on this comparison.
global inherited sharing class BillingContextRelease extends APICommonsService.BatchContext
A structure containing a list of IDs of billing events belonging to unreleased billing events to be released. This class/type extends APICommonsService.BatchContext.
global inherited sharing class BillingContextRecalc extends APICommonsService.BatchContext
A structure containing a list of IDs of unreleased billing events on which to recalculate billing data for. This class/type extends APICommonsService.BatchContext.
Set of billing record IDs of unreleased billing events to be removed. This must contain IDs of objects that belong to the same type. For instance, either billing event items or billing events.
Id of the region, practice or group to schedule billing event generation for. At least one regionID, practiceID or groupID must be specified. If any one of these contains a null value, this means that billing events will be generated for any child regions, practices or groups.
practiceID
Id
Id of the region, practice or group to schedule billing event generation for. At least one regionID, practiceID or groupID must be specified. If any one of these contains a null value, this means that billing events will be generated for any child regions, practices or groups.
groupID
Id
Id of the region, practice or group to schedule billing event generation for. At least one regionID, practiceID or groupID must be specified. If any one of these contains a null value, this means that billing events will be generated for any child regions, practices or groups.
timePeriodID
Id
Id of the time period to generate billing events for. If useFlexiblePeriods is true, this parameter is ignored.
accountID
Id
Id of the account to generate billing events for.
projectID
Id
Id of the project to generate billing events for.
includePriorPeriods
Boolean
Determines whether billing events are to be generated for all time periods prior to the one in timePeriodID. If useFlexiblePeriods is true, this parameter is ignored.
useFlexiblePeriods
Boolean
Indicates whether billing events are to be generated in flexible time period mode. When true, billing events are based on the periodOffset date instead of a time period. The periodOffset determines the cut-off date relative to today's date. When false, the periodOffset indicates which time period to generate billing events for.
periodOffset
Integer
The offset to use to calculate the cut-off date relative to today's date when useFlexiblePeriods is true. When useFlexiblePeriods is false, this determines which time period to generate billing events for. For instance, a value of 0 generates billing events for the current time period and -1 generates billing events for the previous time period.
scheduledJobName
String
Name to be applied to the scheduled job
cronSchedule
String
String defined by Salesforce that represents the schedule used to run the job. For more information, see the Apex Scheduler topic in the Salesforce Apex Code Developer's Guide.
If a value is specified, filters billing data based on whether it is released. When true, only records that are released are returned. When false, only records that are not released are returned. When no value is specified, records are returned regardless of whether they are released.
isInvoiced
Boolean
If a value is specified, filters billing data based on whether it is invoiced. When true, only records that are invoiced are returned. When false, only records that are not invoiced are returned. When no value is specified, records are returned regardless of whether they are invoiced.
isApproved
Boolean
If a value is specified, filters billing data based on whether it is approved. When true, only records that are approved are returned. When false, only records that are not approved are returned. When no value is specified, records are returned regardless of whether they are approved.
global pse.APICommonsService.BatchJobType getJobType()
This method must be implemented by the creator of any class that implements the iBatchCallback interface. This indicates the PSA billing process that the class is to intends to implement. These PSA billing processes all confirm that the implemented type matches their identity: • Clear • Generate • Invoice • Recalc • Release • Remove
Return Value
This method returns an APICommonsService.BatchJobType object.
Sample Code
1
2
3
4
5
//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(){returnpse.APICommonsService.BatchJobType.Generate;}
global inherited sharing class DefaultBillingReleaseHandler implements APICommonsService.iBatchCallback
A structure containing the methods in the iBatchCallback interface that hook into the billing Release process. See "Interface: iBatchCallback". CX_Ignore_Sharing This code is called by the PSA Billing process which operates in a without sharing context. Only the afterFinish defualt implementation does anything, and there it is appropriate to run without sharing. It is expected that this class will be extended by custom code which can declare its own sharing.
global pse.APICommonsService.BatchJobType getJobType()
This method must be implemented by the creator of any class that implements the iBatchCallback interface. This indicates the PSA billing process that the class is to intends to implement. These PSA billing processes all confirm that the implemented type matches their identity: • Clear • Generate • Invoice • Recalc • Release • Remove
Return Value
This method returns an APICommonsService.BatchJobType object.
Sample Code
1
2
3
4
5
//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(){returnpse.APICommonsService.BatchJobType.Release;}