Accounting Apex API Developer Reference

c2g.MergeAccountsService

global with sharing class MergeAccountsService

The service class relating to Merge Accounts.

Methods

MergeAccountsService

global MergeAccountsService()

mergeAccounts

global static c2g.MergeAccountsService.MergeAccountsResponse mergeAccounts(List<c2g.MergeAccountsService.MergeAccounts> mergeAccounts)

This service validates the accounts to be merged, and merges child accounts into master accounts in bulk.

Input Parameters

Name Type Description
mergeAccounts List<c2g.MergeAccountsService.MergeAccounts> List of master accounts and child accounts to be merged

Return Value

MergeAccountsResponse which contains a Batch Job Id and the MergeAccounts list.

c2g.MergeAccountsService.MergeAccounts

global class MergeAccounts

Holds the master and child accounts, and any validation errors that occurred during the merge operation.

Methods

MergeAccounts

global MergeAccounts(ID masterAccountId, ID mergeAccount1Id, ID mergeAccount2Id, Boolean overWriteMergedAccount)

This is the constructor for MergeAccounts class.

Input Parameters

Name Type Description
masterAccountId ID Id of Master Account
mergeAccount1Id ID Id of Child Account 1
mergeAccount2Id ID Id of Child Account 2
overWriteMergedAccount Boolean When True, accounts that have already been merged are merged again (for example, if they were involved in an incomplete merge process). When False, accounts that have already been merged are not merged again.

getMasterAccountId

global Id getMasterAccountId()

Required. Id of Master Account.

getMergeAccount1Id

global Id getMergeAccount1Id()

Id of Child Account1.

getMergeAccount2Id

global Id getMergeAccount2Id()

Id of Child Account2.

getOverWriteMergedAccount

global Boolean getOverWriteMergedAccount()

Pass True if an account is involved in an incomplete merge process and you want to merge it again in the current merge process. Pass False if you do not want to merge an account again.

getErrors

global List<String> getErrors()

Get a list of all validation errors.

c2g.MergeAccountsService.MergeAccountsResponse

global class MergeAccountsResponse

This class provides information about all the accounts in the mergeAccounts list, and the batch Job Id.

Methods

MergeAccountsResponse

global MergeAccountsResponse(List<c2g.MergeAccountsService.MergeAccounts> mergeAccounts, Id apexJobId)

This is the constructor for MergeAccountsResponse class.

Input Parameters

Name Type Description
mergeAccounts List<c2g.MergeAccountsService.MergeAccounts> This list contains all the mergeAccounts with List of error messages.
apexJobId Id The Id of the batch job for the merge process.

getMergeAccounts

global List<c2g.MergeAccountsService.MergeAccounts> getMergeAccounts()

This list contains all the mergeAccounts with a list of error messages. If all validations pass this list will be empty, otherwise it will contain error messages for the associated merge account.

getAsynApexJobId

global Id getAsynApexJobId()

The Id of the batch job for the merge process.

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