NetSuite Development Notes
Friday, June 21, 2019
Execute getConsolidatedExchangeRate in PHP Toolkit
This provides a sample code to make a getConsolidatedExchangeRate request using PHPToolkit 2013.1. The article requires a basic understanding of PHP and Web Services to get this working.
<?phprequire_once '../PHPToolkit/NetSuiteService.php';set_time_limit(0);$service = new NetSuiteService();$exRateFilter = new ConsolidatedExchangeRateFilter();$periodRef = new RecordRef();$periodRef->internalId = '4';$exRateFilter->period = $periodRef;$fromSubRef = new RecordRef();$fromSubRef->internalId = '4';$exRateFilter->fromSubsidiary = $fromSubRef;$toSubRef = new RecordRef();$toSubRef->internalId = '1';$exRateFilter->toSubsidiary = $toSubRef;$request = new GetConsolidatedExchangeRateRequest();$request->consolidatedExchangeRateFilter = $exRateFilter;$getResponse = $service->getConsolidatedExchangeRate($request);$consolidatedExchangeRate = $getResponse->getConsolidatedExchangeRateResult->consolidatedExchangeRateList->consolidatedExchangeRate[0];echo "period: " . $consolidatedExchangeRate->period->internalId . "<br />";echo "fromSubsidiary: " . $consolidatedExchangeRate->fromSubsidiary->internalId . "<br />";echo "toSubsidiary: " . $consolidatedExchangeRate->toSubsidiary->internalId . "<br />";echo "currentRate: " . $consolidatedExchangeRate->currentRate . "<br />";echo "averageRate: " . $consolidatedExchangeRate->averageRate . "<br />";echo "historicalRate: " . $consolidatedExchangeRate->historicalRate . "<br />";
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment