Forum Discussion

JohannJ's avatar
JohannJ
New Contributor II
5 months ago

Adding new source currency with setFxRate automatically

Hi,

I'm currently setting FxRates via BR using below snippet:

objFxRatePk = new FxRatePkUsingNames(osFxRateType, osFxRateDate, sourceCurrency, targetCurrency);
objFxRate = new FxRateUsingNames(objFxRatePk, decimal.Parse(rate), true, false);
objFxRateList.Add(objFxRate);
// <removed for brevity)
BRApi.Finance.Data.SetFxRate(si, item);
// <snip>
BRApi.Finance.Data.LockFxRate(si, rateType, currentMonth);

It works fine but when a new source currency is added, it doesn't show up in Application/FX Rates table.

*** EDIT - realized I didn't phrase this very well ***

Am I missing a step somewhere?

Am I missing a step somewhere to automate this? Or is it not possible?

  • I think you will need to add the currency to the Application Properties Currencies list before it shows on the FX Rates module.

  • MarcusH's avatar
    MarcusH
    Contributor III

    I think you will need to add the currency to the Application Properties Currencies list before it shows on the FX Rates module.

    • JohannJ's avatar
      JohannJ
      New Contributor II

      Yes, that's what I think too, I was just hoping there was some way around that

      • MarcusH's avatar
        MarcusH
        Contributor III

        You could update the AppProperty table with the new currency. The record you want is Name = CurrencyFilter and TextValue contains the list of application currencies separated by a comma. I don't know what impact that will have on other aspects of the application. And you will have to make sure it's a valid currency as the FXRate table uses a CurrencyID column. I don't know where/if the currency list is held. I wouldn't do it.