Accounting API Developer's Reference
|
c2g.AllocationsServiceglobal with sharing class AllocationsService The service class relating to Allocations. EnumsDateRangeTypeIndicates whether the allocation process will select transactions using a date range or a period range.
FilterStructureTypeThe list of valid filter structure types. Set the FilterStructureType of the filterStructure with the field values of this enumeration.
DefaultFilterCriteriaThe list of valid default filter criteria types.
FilterCriteriaThe list of valid filter criteria types.
DestinationTypeThe list of valid destination types. These are the document types that the Allocation process creates.
Methods
getFiltersWithValuesglobal static List<c2g.AllocationsService.FilterDataStructure> getFiltersWithValues(List<c2g.AllocationsService.RefineFilterStructure> refineFilterStructureList) This method returns the reference values that contain the ID and Name. Input Parameters
Return ValueThis service returns a list of c2g.AllocationsService.FilterDataStructure objects 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. List<AllocationsService.FilterDataStructure> filterDataStructureList = c2g.AllocationsService.getFiltersWithValues( new List<c2g.AllocationsService.RefineFilterStructure>{ new c2g.AllocationsService.RefineFilterStructure('c2g__codaGeneralLedgerAccount__c', '', null) } ); retrieveglobal static c2g.AllocationsService.RetrieveStructure retrieve(c2g.AllocationsService.Template template) Retrieves a RetrieveStructure with the required information to create Allocation Transaction Line Items. For example, Company, General Ledger Accounts and Dimensions. Input Parameters
Return ValueThis service returns a c2g.AllocationsService.RetrieveStructure 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. c2g.AllocationsService.Template template = new c2g.AllocationsService.Template(); template.Id = 'a04240000008ALi'; template.ToDate = system.today(); c2g.AllocationsService.RetrieveStructure retrieveStr = c2g.AllocationsService.retrieve(template); createAllocationsglobal static List<Id> createAllocations(List<c2g.AllocationsService.AllocationsStructure> allocationsStructureList) This method creates the allocation transaction or journal based on an AllocationStructure created by the developer. Input Parameters
Return ValueThis service a list of Id objects. 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. c2g.AllocationsService.RetrieveData retrieveData1 = new c2g.AllocationsService.RetrieveData(); retrieveData1.GeneralLedgerAccountId = 'a1Lw00000020For'; retrieveData1.Dimension1Id = 'a1Cw00000002w45'; retrieveData1.Dimension2Id = 'a1Dw0000001BIuj'; retrieveData1.Dimension3Id = 'a1Ew000000Io7j6'; retrieveData1.Dimension4Id = 'a1Fw00000014wzA'; retrieveData1.TransactionLineItemsSumValue = 100; c2g.AllocationsService.SplitData splitData1 = new c2g.AllocationsService.SplitData(); splitData1.GeneralLedgerAccountId = 'a1Lw00000020For'; splitData1.Dimension1Id = 'a1Cw00000002w45'; splitData1.Dimension2Id = 'a1Dw0000001BIuj'; splitData1.Amount = 25; c2g.AllocationsService.SplitData splitData2 = new c2g.AllocationsService.SplitData(); splitData2.GeneralLedgerAccountId = 'a1Lw00000020For'; splitData2.Dimension3Id = 'a1Ew000000Io7j6'; splitData2.Dimension4Id = 'a1Fw00000014wzA'; splitData2.Amount = 75; c2g.AllocationsService.AllocationsStructure allocationStr = new c2g.AllocationsService.AllocationsStructure(); allocationStr.RetrieveDataList = new List<c2g.AllocationsService.RetrieveData> {retrieveData1}; allocationStr.SplitDataList = new List<c2g.AllocationsService.SplitData>{splitData1, splitData2}; allocationStr.AllocationsDate = System.today(); allocationStr.PeriodId = 'a1uw0000001Kd6l'; List<Id> transactionIdList = c2g.AllocationsService.createAllocations(new List<c2g.AllocationsService.AllocationsStructure> {allocStructure}); saveTemplatesglobal static List<Id> saveTemplates(List<c2g.AllocationsService.Template> templateList) This method saves a list of templates. This method also deletes the existing record and creates a new one with the old and new values. Input Parameters
Return ValueThis service a list of Id objects. 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. c2g.AllocationsService.Filter filter1 = new c2g.AllocationsService.Filter(); filter1.FilterCriteria = c2g.AllocationsService.FilterCriteria.MultiselectValue; filter1.Values = new List<Object> {'a1Cw00000002w45'}; c2g.AllocationsService.FilterStructure filterStr1 = new c2g.AllocationsService.FilterStructure(); filterStr1.FilterPosition = 1; filterStr1.FilterStructureType = c2g.AllocationsService.FilterStructureType.Dimension1; filterStr1.DefaultFilterCriteria = c2g.AllocationsService.DefaultFilterCriteria.MultiselectValue; filterStr1.FilterList = new List<c2g.AllocationsService.Filter>{filter1}; c2g.AllocationsService.SplitStructure splitStr1 = new c2g.AllocationsService.SplitStructure(); splitStr1.GeneralLedgerAccountId = 'a1Lw00000020For'; splitStr1.Dimension1Id = 'a1Cw00000002w45'; splitStr1.Percentage = 20; c2g.AllocationsService.SplitStructure splitStr2 = new c2g.AllocationsService.SplitStructure(); splitStr2.GeneralLedgerAccountId = 'a1Lw00000020For'; splitStr2.Dimension1Id = 'a1Cw00000002w45'; splitStr2.Percentage = 80; c2g.AllocationsService.Template template = new c2g.AllocationsService.Template(); template.Name = 'Template1'; template.Description = 'Template Description'; template.FilterStructureList = new List<c2g.AllocationsService.FilterStructure> {filterStr1}; template.SplitStructureList = new List<c2g.AllocationsService.SplitStructure> {splitStr1, splitStr2}; List<id> templateId = c2g.AllocationsService.saveTemplates( new List<c2g.AllocationsService.Template> {template} ); loadTemplatesglobal static List<c2g.AllocationsService.Template> loadTemplates(Set<Id> templateIds) This method creates the allocation transaction or journal based on an AllocationStructure created by the developer. Input Parameters
Return ValueThis service returns a list of Id objects. 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. List<c2g.AllocationsService.Template> templateList = c2g.AllocationsService.loadTemplates(new Set<id> {'a04240000008ALi'}); calculateSplitDataLinesglobal static List<c2g.AllocationsService.SplitData> calculateSplitDataLines(List<c2g.AllocationsService.SplitStructure> splitStructureList, Decimal totalAmount) This method calculates Split Data Lines from Split Structure Lines and total amount. Input Parameters
Return ValueThis service a list of c2g.AllocationsService.SplitData objects. 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. c2g.AllocationsService.SplitStructure splitStr1 = new c2g.AllocationsService.SplitStructure(); splitStr1.GeneralLedgerAccountId = 'a1Lw00000020For'; splitStr1.Dimension1Id = 'a1Cw00000002w45'; splitStr1.Dimension2Id = 'a1Dw0000001BIuj'; splitStr1.percentage= 20; c2g.AllocationsService.SplitStructure splitStr2 = new c2g.AllocationsService.SplitStructure(); splitStr2.GeneralLedgerAccountId = 'a1Lw00000020For'; splitStr2.Percentage = 80; List<c2g.AllocationsService.SplitData> splitLines = c2g.AllocationsService.calculateSplitDataLines(new List<c2g.AllocationsService.SplitStructure>{splitStr1, splitStr2}, 33.33); calculateSplitDataLinesglobal static List<c2g.AllocationsService.SplitData> calculateSplitDataLines(List<c2g.AllocationsService.SplitStructure> splitStructureList, c2g.AllocationsService.AllocationsStructure allocationsStructure) This method calculates Split Data Lines from Split Structure Lines and Allocations Structure in single or multi-company mode. Input Parameters
Return ValueThis service returns a list of c2g.AllocationsService.SplitData objects. 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. c2g.AllocationsService.SplitStructure splitStructure1 = new c2g.AllocationsService.SplitStructure(); splitStructure1.GeneralLedgerAccountId = 'a1Lw00000020For'; splitStructure1.Dimension1Id = 'a1Cw00000002w45'; splitStructure1.Dimension2Id = 'a1Dw0000001BIuj'; splitStructure1.percentage= 20; c2g.AllocationsService.SplitStructure splitStructure2 = new c2g.AllocationsService.SplitStructure(); splitStructure2.GeneralLedgerAccountId = 'a1Lw00000020For'; splitStructure2.Percentage = 80; List<c2g.AllocationsService.SplitStructure> splitStructureList = new List<c2g.AllocationsService.SplitStructure>{splitStructure1,splitStructure2}; c2g.AllocationsService.RetrieveData retrieveData = new c2g.AllocationsService.RetrieveData(); retrieveData.GeneralLedgerAccountId = 'a1Lw00000020For'; retrieveData.Dimension1Id = 'a1Cw00000002w45'; retrieveData.Dimension4Id = 'a1Dw0000001BIuj'; retrieveData.TransactionLineItemsSumValue = 10000; List<c2g.AllocationsService.RetrieveData> retrieveDataList = new List<c2g.AllocationsService.RetrieveData>{retrieveData}; c2g.AllocationsService.AllocationsStructure allocationsStructure = new c2g.AllocationsService.AllocationsStructure(); allocationsStructure.RetrieveDataList = retrieveDataList; List<c2g.AllocationsService.SplitData> splitDataList = c2g.AllocationsService.calculateSplitDataLines(splitStructureList, allocationsStructure); c2g.AllocationsService.RefineFilterStructureglobal class RefineFilterStructure Holds the filters to retrieve the lookup values. 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. c2g.AllocationsService.RefineFilterStructure refineFilterStructure = new c2g.AllocationsService.RefineFilterStructure(); refineFilterStructure.ObjectAPIName = 'codaGeneralLedgerAccount__c'; refineFilterStructure.RefineSearch = 'Accounts'; Properties
Methods
RefineFilterStructureglobal RefineFilterStructure() RefineFilterStructureglobal RefineFilterStructure(String objectAPIName, String refineSearch, Id companyId) Holds the filters to get the lookup values. Input Parameters
Return ValueThis constructor does not return a value. hasObjectAPINameglobal Boolean hasObjectAPIName() Determines if the ObjectAPIName has been populated in the RefineFilterStructure. Return ValueThis service returns a Boolean 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. c2g.AllocationsService.RefineFilterStructure refineFilterStructure = new c2g.AllocationsService.RefineFilterStructure(); refineFilterStructure.ObjectAPIName = 'codaGeneralLedgerAccount__c'; System.assertEquals(true, refineFilterStructure.hasObjectAPIName()); c2g.AllocationsService.FilterDataStructureglobal class FilterDataStructure Holds a list of entities and the default entity value. 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. List<AllocationsService.FilterDataStructure> filterDataStructureList = c2g.AllocationsService.getFiltersWithValues( new List<c2g.AllocationsService.RefineFilterStructure>{ new c2g.AllocationsService.RefineFilterStructure('c2g__codaGeneralLedgerAccount__c', '', null) } ); Properties
Methods
FilterDataStructureglobal FilterDataStructure() FilterDataStructureglobal FilterDataStructure(c2g.AllocationsService.EntityValue defaultEntityValue, List<c2g.AllocationsService.EntityValue> filterDataList) Holds a list of entities as well as the default entity value. Input Parameters
Return ValueThis constructor does not return a value. c2g.AllocationsService.RetrieveStructureglobal class RetrieveStructure Holds the company ID and required information to create Allocation Transaction Line Items grouped by general ledger accounts and dimensions. 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. List<c2g.AllocationsService.Template> templateList = c2g.AllocationsService.loadTemplates(new Set<id> {'a04240000008ALi'}); c2g.AllocationsService.RetrieveStructure retrieveStr = c2g.AllocationsService.retrieve(templateList[0]); Decimal totalAmount = 0; for (c2g.AllocationsService.RetrieveData retrieveData : retrieveStr.RetrieveDataList) { totalAmount += retrieveData.TransactionLineItemsSumValue; } List<c2g.AllocationsService.SplitData> splitDataList = c2g.AllocationsService.calculateSplitDataLines(templateList[0].SplitStructureList, totalAmount); c2g.AllocationsService.AllocationsStructure allocationStr = new c2g.AllocationsService.AllocationsStructure(); allocationStr.RetrieveDataList = retrieveStr.RetrieveDataList; allocationStr.SplitDataList = splitDataList; allocationStr.AllocationsDate = System.today(); List<Id> transactionIdList = c2g.AllocationsService.createAllocations( new List<c2g.AllocationsService.AllocationsStructure>{allocationStr} ); Properties
Methods
RetrieveStructureglobal RetrieveStructure() RetrieveStructureglobal RetrieveStructure(c2g.AllocationsService.CompanyData companyInfo, List<c2g.AllocationsService.RetrieveData> retrieveDataList) Retrieves a RetrieveStructure with the required information to create Allocation Transaction Line Items. For example, Company, General Ledger Accounts and Dimensions. Input Parameters
Return ValueThis constructor does not return a value. c2g.AllocationsService.Entitiesglobal abstract class Entities Holds general ledger accounts (EntityValue), with Dimensions 1 to 4 (EntityValue). You can only populate the general ledger account or general ledger account and dimensions. The general ledger account is mandatory. 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. c2g.AllocationsService.Entities entities = new c2g.AllocationsService.Entities(); entities.GeneralLedgerAccountId = 'a1Lw00000020For'; entities.Dimension1Id = 'a1Cw00000002w45'; entities.Dimension2Id = 'a1Dw0000001BIuj'; entities.Dimension3Id = 'a1Ew000000Io7j6'; entities.Dimension4Id = 'a1Fw00000014wzA'; Properties
Methods
Entitiesglobal Entities() Entitiesglobal Entities(Id generalLedgerAccountId, Id dimension1Id, Id dimension2Id, Id dimension3Id, Id dimension4Id) CHolds a general ledger EntityValue and may have Dimension1, 2, 3 or 4 EntityRetrieveValue. Input Parameters
Return ValueThis constructor does not return a value. c2g.AllocationsService.RetrieveDataglobal class RetrieveData extends Entities Holds the same fields as the Entities class as well as the sum of HomeValues. This class extends - c2g.AllocationsService.Entities 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. c2g.AllocationsService.RetrieveData retrieveData1 = new c2g.AllocationsService.RetrieveData(); retrieveData1.GeneralLedgerAccountId = 'a1Lw00000020For'; retrieveData1.Dimension1Id = 'a1Cw00000002w45'; retrieveData1.Dimension2Id = 'a1Dw0000001BIuj'; retrieveData1.Dimension3Id = 'a1Ew000000Io7j6'; retrieveData1.Dimension4Id = 'a1Fw00000014wzA'; retrieveData1.TransactionLineItemsSumValue = 100; c2g.AllocationsService.SplitData splitData1 = new c2g.AllocationsService.SplitData(); splitData1.GeneralLedgerAccountId = 'a1Lw00000020For'; splitData1.Dimension1Id = 'a1Cw00000002w45'; splitData1.Dimension2Id = 'a1Dw0000001BIuj'; splitData1.Amount = 25; c2g.AllocationsService.SplitData splitData2 = new c2g.AllocationsService.SplitData(); splitData2.GeneralLedgerAccountId = 'a1Lw00000020For'; splitData2.Dimension3Id = 'a1Ew000000Io7j6'; splitData2.Dimension4Id = 'a1Fw00000014wzA'; splitData2.Amount = 75; c2g.AllocationsService.AllocationsStructure allocationStr = new c2g.AllocationsService.AllocationsStructure(); allocationStr.RetrieveDataList = new List<c2g.AllocationsService.RetrieveData> {retrieveData1}; allocationStr.SplitDataList = new List<c2g.AllocationsService.SplitData>{splitData1, splitData2}; allocationStr.AllocationsDate = System.today(); allocationStr.PeriodId = 'a1uw0000001Kd6l'; List<Id> transactionIdList = c2g.AllocationsService.createAllocations(new List<c2g.AllocationsService.AllocationsStructure> {allocStructure}); Properties
Methods
RetrieveDataglobal RetrieveData() RetrieveDataglobal RetrieveData(Id generalLedgerAccountId, Id dimension1Id, Id dimension2Id, Id dimension3Id, Id dimension4Id, Decimal transactionLineItemsSumValue) Holds the same fields as the Entities class and the sum of HomeValues. Input Parameters
Return ValueThis constructor does not return a value. c2g.AllocationsService.SplitDataglobal class SplitData extends Entities Holds the same fields as the Entities class as well as the split amount. This class extends - c2g.AllocationsService.Entities 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. c2g.AllocationsService.SplitStructure splitStr1 = new c2g.AllocationsService.SplitStructure(); splitStr1.GeneralLedgerAccountId = 'a1Lw00000020For'; splitStr1.Dimension1Id = 'a1Cw00000002w45'; splitStr1.Dimension2Id = 'a1Dw0000001BIuj'; splitStr1.percentage= 20; c2g.AllocationsService.SplitStructure splitStr2 = new c2g.AllocationsService.SplitStructure(); splitStr2.GeneralLedgerAccountId = 'a1Lw00000020For'; splitStr2.Percentage = 80; List<c2g.AllocationsService.SplitData> splitLines = c2g.AllocationsService.calculateSplitDataLines(new List<c2g.AllocationsService.SplitStructure>{splitStr1, splitStr2}, 33.33); Properties
Methods
SplitDataglobal SplitData() SplitDataglobal SplitData(Id generalLedgerAccountId, Id dimension1Id, Id dimension2Id, Id dimension3Id, Id dimension4Id, Decimal amount) Holds the same fields as the Entities class as well as the amount of the split. Input Parameters
Return ValueThis constructor does not return a value. c2g.AllocationsService.EntityValueglobal class EntityValue Holds the ID and name of the entity. 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. c2g.AllocationsService.EntityValue entityValue = new c2g.AllocationsService.EntityValue(); entityValue.Id = 'a1Lw00000020For'; entityValue.Name = 'Sales - Parts'; Properties
MethodsEntityValueglobal EntityValue() EntityValueglobal EntityValue(String id, String name) Holds the ID and Name. Input Parameters
Return ValueThis constructor does not return a value. c2g.AllocationsService.CompanyDataglobal class CompanyData Holds the company ID. 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. c2g.AllocationsService.CompanyData companyData = new c2g.AllocationsService.CompanyData(); companyData.CompanyId = 'a0m24000000cST6'; Properties
MethodsCompanyDataglobal CompanyData() CompanyDataglobal CompanyData(Id companyId) Holds the company ID. Input Parameters
Return ValueThis constructor does not return a value. c2g.AllocationsService.Templateglobal class Template Holds the information necessary to filter the transaction line items in the retrieve process. It is also used to save, update and load a template. 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. // Using ID c2g.AllocationsService.Template template = new c2g.AllocationsService.Template(); template.Id = 'a04240000008ALi'; template.ToDate = system.today(); c2g.AllocationsService.RetrieveStructure retrieveStr = c2g.AllocationsService.retrieve(template); // Using Name c2g.AllocationsService.Template template = new c2g.AllocationsService.Template(); template.Name = 'Template 2'; template.ToDate = system.today(); c2g.AllocationsService.RetrieveStructure retrieveStr = c2g.AllocationsService.retrieve(template); Properties
Methods
Templateglobal Template() Templateglobal Template(Id id, String name, Date fromDate, Date toDate) Holds the information necessary to filter the transaction line items in the retrieve process. Input Parameters
Return ValueThis constructor does not return a value. Templateglobal Template(Id id, String name, String description, List<c2g.AllocationsService.FilterStructure> filterStructureList, List<c2g.AllocationsService.SplitStructure> splitStructureList) Holds the information necessary to filter the transaction line items in the retrieve process. Input Parameters
Return ValueThis constructor does not return a value. c2g.AllocationsService.FilterStructureglobal class FilterStructure Holds the structure of each filter set. 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. c2g.AllocationsService.Filter filter1 = new c2g.AllocationsService.Filter(); filter1.FilterCriteria = c2g.AllocationsService.FilterCriteria.MultiselectValue; filter1.Values = new List<Object> {'a1Cw00000002w45'}; c2g.AllocationsService.FilterStructure filterStr1 = new c2g.AllocationsService.FilterStructure(); filterStr1.FilterPosition = 1; filterStr1.FilterStructureType = c2g.AllocationsService.FilterStructureType.Dimension1; filterStr1.DefaultFilterCriteria = c2g.AllocationsService.DefaultFilterCriteria.MultiselectValue; filterStr1.FilterList = new List<c2g.AllocationsService.Filter>{filter1}; c2g.AllocationsService.Template template = new c2g.AllocationsService.Template(); template.ToDate = system.today(); template.FilterStructureList = new List<c2g.AllocationsService.FilterStructure> {filterStr1}; c2g.AllocationsService.RetrieveStructure retrieveStr = c2g.AllocationsService.retrieve(template); Properties
Methods
FilterStructureglobal FilterStructure() FilterStructureglobal FilterStructure(String type, Integer filterPosition, List<c2g.AllocationsService.Filter> filterList) Holds the structure of each filter set. Input Parameters
Return ValueThis constructor does not return a value. FilterStructureglobal FilterStructure(c2g.AllocationsService.FilterStructureType filterStructureType, Integer filterPosition, List<c2g.AllocationsService.Filter> filterList, c2g.AllocationsService.DefaultFilterCriteria defaultFilterCriteria) Holds the structure of each filter set. Input Parameters
Return ValueThis constructor does not return a value. c2g.AllocationsService.Filterglobal class Filter Holds the values for each FilterStructure depending on the FilterCriteria. 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. c2g.AllocationsService.Filter filter1 = new c2g.AllocationsService.Filter(); filter1.FilterCriteria = c2g.AllocationsService.FilterCriteria.MultiselectValue; filter1.Values = new List<Object> {'a1Cw00000002w45'}; c2g.AllocationsService.FilterStructure filterStr1 = new c2g.AllocationsService.FilterStructure(); filterStr1.FilterPosition = 1; filterStr1.FilterStructureType = c2g.AllocationsService.FilterStructureType.Dimension1; filterStr1.DefaultFilterCriteria = c2g.AllocationsService.DefaultFilterCriteria.MultiselectValue; filterStr1.FilterList = new List<c2g.AllocationsService.Filter>{filter1}; c2g.AllocationsService.SplitStructure splitStr1 = new c2g.AllocationsService.SplitStructure(); splitStr1.GeneralLedgerAccountId = 'a1Lw00000020For'; splitStr1.Dimension1Id = 'a1Cw00000002w45'; splitStr1.Percentage = 20; c2g.AllocationsService.SplitStructure splitStr2 = new c2g.AllocationsService.SplitStructure(); splitStr2.GeneralLedgerAccountId = 'a1Lw00000020For'; splitStr2.Dimension1Id = 'a1Cw00000002w45'; splitStr2.Percentage = 80; c2g.AllocationsService.Template template = new c2g.AllocationsService.Template(); template.Name = 'Template1'; template.Description = 'Template Description'; template.FilterStructureList = new List<c2g.AllocationsService.FilterStructure> {filterStr1}; template.SplitStructureList = new List<c2g.AllocationsService.SplitStructure> {splitStr1, splitStr2}; List<id> templateId = c2g.AllocationsService.saveTemplates( new List<c2g.AllocationsService.Template> {template} ); Properties
Methods
Filterglobal Filter() Filterglobal Filter(c2g.AllocationsService.FilterCriteria filterCriteria, List<Object> values) Holds the values for each FilterStructure depending on the FilterCriteria. Input Parameters
Return ValueThis constructor does not return a value. c2g.AllocationsService.SplitStructureglobal class SplitStructure extends Entities Holds the same fields as the Entities class as well as the split percentage. This class extends - c2g.AllocationsService.Entities 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. c2g.AllocationsService.SplitStructure splitStr1 = new c2g.AllocationsService.SplitStructure(); splitStr1.GeneralLedgerAccountId = 'a1Lw00000020For'; splitStr1.Dimension1Id = 'a1Cw00000002w45'; splitStr1.Dimension2Id = 'a1Dw0000001BIuj'; splitStr1.percentage= 20; c2g.AllocationsService.SplitStructure splitStr2 = new c2g.AllocationsService.SplitStructure(); splitStr2.GeneralLedgerAccountId = 'a1Lw00000020For'; splitStr2.Percentage = 80; List<c2g.AllocationsService.SplitData> splitLines = c2g.AllocationsService.calculateSplitDataLines(new List<c2g.AllocationsService.SplitStructure>{splitStr1, splitStr2}, 33.33); Properties
Methods
SplitStructureglobal SplitStructure() SplitStructureglobal SplitStructure(Id generalLedgerAccountId, Id dim1Id, Id dim2Id, Id dim3Id, Id dim4Id, Decimal percentage) Holds the same fields as the Entities class as well as the split percentage. Input Parameters
Return ValueThis constructor does not return a value. c2g.AllocationsService.AllocationsStructureglobal class AllocationsStructure Holds information of the RetrieveDataList and the SplitDataList of the RetrieveStructure. 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. c2g.AllocationsService.RetrieveData retrieveData1 = new c2g.AllocationsService.RetrieveData(); retrieveData1.GeneralLedgerAccountId = 'a1Lw00000020For'; retrieveData1.Dimension1Id = 'a1Cw00000002w45'; retrieveData1.Dimension2Id = 'a1Dw0000001BIuj'; retrieveData1.Dimension3Id = 'a1Ew000000Io7j6'; retrieveData1.Dimension4Id = 'a1Fw00000014wzA'; retrieveData1.TransactionLineItemsSumValue = 100; c2g.AllocationsService.SplitData splitData1 = new c2g.AllocationsService.SplitData(); splitData1.GeneralLedgerAccountId = 'a1Lw00000020For'; splitData1.Dimension1Id = 'a1Cw00000002w45'; splitData1.Dimension2Id = 'a1Dw0000001BIuj'; splitData1.Amount = 25; c2g.AllocationsService.SplitData splitData2 = new c2g.AllocationsService.SplitData(); splitData2.GeneralLedgerAccountId = 'a1Lw00000020For'; splitData2.Dimension3Id = 'a1Ew000000Io7j6'; splitData2.Dimension4Id = 'a1Fw00000014wzA'; splitData2.Amount = 75; c2g.AllocationsService.AllocationsStructure allocationStr = new c2g.AllocationsService.AllocationsStructure(); allocationStr.RetrieveDataList = new List<c2g.AllocationsService.RetrieveData> {retrieveData1}; allocationStr.SplitDataList = new List<c2g.AllocationsService.SplitData>{splitData1, splitData2}; allocationStr.AllocationsDate = System.today(); allocationStr.PeriodId = 'a1uw0000001Kd6l'; List<Id> transactionIdList = c2g.AllocationsService.createAllocations(new List<c2g.AllocationsService.AllocationsStructure> {allocStructure}); Properties
Methods
AllocationsStructureglobal AllocationsStructure() AllocationsStructureglobal AllocationsStructure(List<c2g.AllocationsService.RetrieveData> retrieveDataList, List<c2g.AllocationsService.SplitData> splitDataList, Date allocationsDate, Id periodId, String description) Holds the RetrieveStructure and adds the SplitDataList. Input Parameters
Return ValueThis constructor does not return a value. |