Pages

Banner 468 x 60px

 

Monday, March 27, 2017

Get the Exchange Rates for the given Currency using X++

0 comments
Get the Exchange Rates for the given Currency using X++:

static void GetExchangeRates(Args _args)
{
  com com = new com(microsoft.xmlhttp);
  com com1;  
  XMLDocument xmlDoc;
  Dialog exchDialog = new Dialog("Exchange Rates");  
  DialogField   fromField;  
  DialogField   ToField;  
  str    url;
  ;  
  fromField = exchDialog.addField(Types::String, Base Currency);  
  fromField.value(CompanyInfo::find().CurrencyCode);  
  ToField   =exchDialog.addField(Types::String, To Currency);  
  if(exchDialog.run())
  {
    url = "http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?&quot”;
    url += "FromCurrency=" +strupr(fromField.value())+"&ToCurrency="+strupr(ToField.value());       
    com.open("get",url);      
    com.send();      
    com1 = com.responsexml();
    xmlDoc = XmlDocument::newXml(com1.xml());      
    info("1 "+fromField.value() + " = " +xmlDoc.getNamedElement(double).text() + " " +ToField.value());
  }
}

0 comments:

A financial dimension value is based on the LAND-00013 record and has been used on a transaction. You cannot delete the LAND-00013 record AX 2012

 A financial dimension value is based on the LAND-00013 record and has been used on a  transaction. You cannot delete the LAND-00013 record ...