Accounting Apex API Developer Reference

c2g.CODAAPICompany_2_0

global with sharing class CODAAPICompany_2_0

Retrieves a list of your current companies. Current companies are those that you have been granted access to and have also selected as current.

Properties

Name Type Description
VERSION_STRING string The API version of this service class.
SERVICE_NAME string The service name of this service class.
LOGICAL_VOCAB_PREFIX string For internal use only.

Methods

GetAPIVersion

webService static string GetAPIVersion()

Used to get the latest API version.

GetServiceName

webService static string GetServiceName()

Used to get the name of the service.

GetCurrentCompanies

webService static List<String> GetCurrentCompanies(c2g.CODAAPICommon_2_0.Context context)

Retrieves a list of your current companies.

Input Parameters

Name Type Description
context c2g.CODAAPICommon_2_0.Context This parameter is obsolete for this operation, and can be ignored.

Return Value

Returns the current company names.

SetCurrentCompanies

webService static void SetCurrentCompanies(List<String> companies)

Enables you to change your current companies. Because of platform restrictions this must be used in an seperate execution context from other DML operations. For more details see Developers Guide Getting Started.

Input Parameters

Name Type Description
companies List<String> The list of companies to make your current companies

Exceptions Thrown

Value Description
CODAException Thrown if any of the companies are not accessible to you

CreateTestCompany

webService static c2g__codaCompany__c CreateTestCompany(String name, String taxMode, String companyCurrency)

Enables you to create a company for use in tests. To use this function you must place it within Test.startTest() and Test.stopTest() statements within a System.runAs block of a unit test. For more details see Developers Guide Getting Started. If this is the first company created it will be made the current company for the current user.

Input Parameters

Name Type Description
name String The name of the company to create
taxMode String The tax mode for the company. Defaults to "VAT" if null or invalid
companyCurrency String Currency ISO code to create for company. Defaults to user default currency if null or invalid
© Copyright 2009–2024 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.