Skip to main content

Different Queryresult in Management Studio and coresuite service

Comments

2 comments

  • MW Sund

    I have find out, the I have to use coresuiteServiceAPI instead of SwissAddonFramework. The query was run in the other database.

    0
  • S. Dietze

    hey, you could just use the API function for setting exchange rates, there is an parameter if existing rates should be updated/overwritten or not. the function can do the validation automatically.

    we use that for fetching the ECB rates (XML) every night and set them using a small CS rule.

    simple code example for the CS rule, of course use proper try/catch etc.:

     

    // create company connection, set string companyDatabase to DB name
    var company = CoresuiteServiceAPI.SAPConnection.CreateConnection(companyDatabase).GetB1Connector().Company;
    SAPbobsCOM.SBObob oSBObob = (SAPbobsCOM.SBObob) company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge);
    // double rate = the exchange rate from source - e.g. Convert.ToDouble(4.254)
    // string curr = currency code (EUR/USD…) as string 
    // bool updateEntries = overwrite existing rates or keep them, in your case set to false
    // loop for each currency - set curr, rate and call API function:
    oSBObob.SetCurrencyRate(curr, DateTime.Now, rate, updateEntries);

     

     

    0

Please sign in to leave a comment.