Accounting API Developer's Reference
|
c2g.ExchangeRateServiceglobal without sharing class ExchangeRateService The service class relating to the management of Exchange Rates. Methods
upsertExchangeRatesOrgWideglobal static void upsertExchangeRatesOrgWide(List<c2g.ExchangeRateService.OrgWideExchangeRate> exchangeRateList) This service enables you to insert and update exchange rates for companies that manage them at org-wide level. Input Parameters
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.ExchangeRateService.OrgWideExchangeRate> rateList = new List<c2g.ExchangeRateService.OrgWideExchangeRate>(); ExchangeRateService.OrgWideExchangeRate rate = new ExchangeRateService.OrgWideExchangeRate(); rate.CurrencyISOCode = 'EUR'; rate.BaseCurrencyISOCode = 'AUD'; rate.Rate = 6.39; rate.EffectiveDate = date.newinstance(2015, 11, 30); rateList.add(rate); ExchangeRateService.upsertExchangeRatesOrgWide(rateList); deleteExchangeRatesOrgWideglobal static void deleteExchangeRatesOrgWide(List<c2g.ExchangeRateService.OrgWideExchangeRate> exchangeRateList) This service deletes org-wide exchange rates. Input Parameters
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<ExchangeRateService.OrgWideExchangeRate> rateList = new List<ExchangeRateService.OrgWideExchangeRate>(); ExchangeRateService.OrgWideExchangeRate rate = new ExchangeRateService.OrgWideExchangeRate(); rate.CurrencyISOCode = 'GBP'; rate.BaseCurrencyISOCode = 'EUR'; rate.EffectiveDate = date.newinstance(2015, 11, 20); rateList.add(rate); ExchangeRateService.deleteExchangeRatesOrgWide(rateList); upsertExchangeRatesCompanySpecificglobal static void upsertExchangeRatesCompanySpecific(List<c2g.ExchangeRateService.CompanySpecificExchangeRate> exchangeRateList) This service enables you to insert and update exchange rates for companies that manage their own rates. Input Parameters
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. Date effectiveDate = date.newinstance(2014, 1, 1); Id companyId = ‘a1Y28000000DmwS’; List<c2g.ExchangeRateService.CompanySpecificExchangeRate> rateList = new List<c2g.ExchangeRateService.CompanySpecificExchangeRate>(); ExchangeRateService.CompanySpecificExchangeRate rate = new ExchangeRateService.CompanySpecificExchangeRate(); rate.CompanyId = companyId; rate.CurrencyISOCode = 'GBP'; rate.BaseCurrencyISOCode = 'EUR'; rate.Rate = 6.39; rate.EffectiveDate = effectiveDate; rateList.add(rate); ExchangeRateService.upsertExchangeRatesCompanySpecific(rateList); deleteExchangeRatesCompanySpecificglobal static void deleteExchangeRatesCompanySpecific(List<c2g.ExchangeRateService.CompanySpecificExchangeRate> exchangeRateList) This service deletes company-specific exchange rates. Input Parameters
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<ExchangeRateService.CompanySpecificExchangeRate> rateList = new List<ExchangeRateService.CompanySpecificExchangeRate>(); ExchangeRateService.CompanySpecificExchangeRate rate = new ExchangeRateService.CompanySpecificExchangeRate(); rate.CompanyId = 'a1i28000000DYZK'; rate.CurrencyISOCode = 'GBP'; rate.EffectiveDate = date.newinstance(2015, 11, 20); rateList.add(rate); ExchangeRateService.deleteExchangeRatesCompanySpecific(rateList); getExchangeRatesOrgWideglobal static List<c2g.ExchangeRateService.OrgWideExchangeRate> getExchangeRatesOrgWide(Date effectiveDate) This service returns org-wide exchange rates for a given date. Input Parameters
Return ValueThis service returns a List<c2g.ExchangeRateService.OrgWideExchangeRate> 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. Date effectiveDate = date.newinstance(2014, 1, 1); ExchangeRateService.getExchangeRatesOrgWide(effectiveDate ); getExchangeRatesCompanySpecificglobal static List<c2g.ExchangeRateService.CompanySpecificExchangeRate> getExchangeRatesCompanySpecific(Date effectiveDate, Id companyId) This service returns company-specific exchange rates for a given date and company. Input Parameters
Return ValueThis service returns a List<c2g.ExchangeRateService.CompanySpecificExchangeRate> 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. Date effectiveDate = date.newinstance(2014, 1, 1); Id companyId = ‘a1Y28000000DmwS’; ExchangeRateService.getExchangeRatesCompanySpecific(effectiveDate,companyId ); c2g.ExchangeRateService.ExchangeRateglobal abstract class ExchangeRate Properties
c2g.ExchangeRateService.OrgWideExchangeRateglobal class OrgWideExchangeRate extends ExchangeRate Holds the structure of an org-wide exchange rate. This class extends - c2g.ExchangeRateService.ExchangeRate 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. ExchangeRateService.OrgWideExchangeRate rate = new ExchangeRateService.OrgWideExchangeRate(); rate.CurrencyISOCode = 'EUR'; rate.BaseCurrencyISOCode = 'AUD'; rate.Rate = 6.39; rate.EffectiveDate = date.newinstance(2015, 11, 30); Properties
c2g.ExchangeRateService.CompanySpecificExchangeRateglobal class CompanySpecificExchangeRate extends ExchangeRate Holds the structure of a company-specific exchange rate. This class extends - c2g.ExchangeRateService.ExchangeRate 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. ExchangeRateService.CompanySpecificExchangeRate rate = new ExchangeRateService.CompanySpecificExchangeRate(); rate.CompanyId = 'a1i28000000DYZK'; rate.CurrencyISOCode = 'GBP'; rate.Rate = 3.45; rate.EffectiveDate = date.newinstance(2015, 11, 20); Properties
|