Apex sync commands for Intacct

Apex is an object-oriented programming language that lets you centralize and execute flow and transaction control statements in Salesforce with application calls to Salesforce APIs. Web service requests and database triggers on objects can also initiate the execution of Apex code.

Sage Intacct has created Apex synchronization commands specifically for the Advanced CRM Integration, allowing you to call and use Intacct Apex classes in your own code.

For more information about Salesforce Apex code, visit the Salesforce Developer site.

SobjectController

The SobjectController class is used to initiate synchronization calls from the code inside the Advanced CRM Integration package, and outside the package. This class is meant to be visible outside the package due to its global access modifier.

Synchronize a single record

To synchronize a single record, use the following as the template:

Copy
Template
ia_crm.SobjectController instance = new 
ia_crm.SobjectController([ObjectName],[RecordId],[Action],[TransactionDefinitionName]);

Single record sync parameters

Parameters

Definition

ObjectName(String)

Name of the object

Example: ’Account’, ’Product2’

RecordId(String)

Salesforce ID of the record

Example: ’ 00000000004MVox’

Action(String)

Can be one of the actions listed in the Action List.

TransactionDefinitionName(String)

Name of the Intacct custom transaction definition

Example: ’Sales Invoice Rev’

The initial synchronization operation is made by calling the customAction() method inside this class. This method type is void; you will not get a return value.

Single record sync example

The following code example is for synchronizing a single record:

Copy

Example

ia_crm.SobjectController instance = new 
ia_crm.SobjectController(’Account’,’ 01t41000000sitr’ , ’SYNC_CUSTOMER’, null); instance.customAction();

Synchronize records in bulk

To synchronize records in bulk, use the following as the template:

Copy
Template
ia_crm.SobjectController instance = new 
ia_crm.SobjectController([ObjectName],[List<Id> RecordIds],[Action],[TransactionDefinitionName]);

Bulk record sync parameters

Parameters Definition
ObjectName(String)

Name of the object.

Example ’Account’, ’Product2’

RecordIds(List<Id>) List of Salesforce record IDs.
Action(String) Can be one of the actions listed in the Action List.
TransactionDefinitionName(String) Name of the Intacct custom transaction definition(Ex: ’Sales Invoice Rev’)

The initial sync operation is made by calling the customAction() method inside this class. This method type is void; you will not get a return value.

Bulk record sync example

The following code example is for synchronizing records in bulk:

Copy

Example

List<Id> recordIds = List<Id>();
ia_crm.SobjectController instance = new ia_crm.SobjectController(’Account’, recordIds, ’SYNC_CUSTOMER’, null);instance.customAction();

Synchronize a transaction

To synchronize a transaction, use the following as the template:

Copy
Template
ia_crm.SobjectController instance = new 
ia_crm.SobjectController({opportunityIds}, {transactionName}, {applyOnlyToEmptyTransactions});
instance.customAction();

Transaction sync parameters

Parameters

Definition

opportunityIds

ID of the opportunity.

Example: a list ID: '0061v00000d2Dhm'

transactionName

The name in the Intacct transaction type field.

Example: 'Sales Invoice’ or 'Sales Order', etc.

applyOnlyToEmptyTransactions

Can be True or False.

Set to TRUE if you want to apply {transactionName} to Opportunities with the Intacct transaction field empty.

Set to FALSE if you want to apply {transactionName} to all Opportunities and overwrite the Intacct transaction field.

The initial synchronization operation is made by calling the customAction() method inside this class. This method type is void; you will not get a return value.

Action List

The following is the list of synchronization operations available in the Advanced CRM Integration package.

Sync operator Definition
SYNC_CUSTOMER Account sync
SYNC_PRODUCT Product sync
SYNC_CONTACT Contact sync
CREATE_CONTRACT Create Contract
SYNC_PRICEBOOK Price Book sync
DELETE_CUSTOMER Delete Account callout
DELETE_CONTACT Delete Contact callout
DELETE_PRODUCT Delete Product callout
DELETE_PRICEBOOK Delete Price Book callout
MERGE_CUSTOMER Merge Accounts
UPDATE_CONTRACT Update Contract
SYNC_RENEWAL_CONTRACT Create Renewal Contract
CREATE_OPPORTUNITY_CONTRACT Sync Contract Add-on
C_SYNC_PRICEBOOK Create/update Contract Price book
SYNC_JOURNAL_ENTRY Create Journal Entry