function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
saariko.ax241saariko.ax241 

DatedConversionRate - Dated Currencies example

I am trying to create a new DatedConversionRate through an API call, but I keep getting an error message.
I can't find any examples for this feature, so I really need some help please.

The error I get is "invalid parameter value"
and than: UNKNOWN_EXCEPTION  (In captial)


This is the code, your help will be appreciated

Please look at the
else if (rbDated.Checked)   part. this is where I handle multicurrency. The first part works perfectly.
Thanks
Code:
        private void updateFunction(string updatedId, string toCurISO)
        {
            formActive(false);
            setResultText("Updating new currency."); 
            
            //            SFenterprise.sObject[] records = binding.query();

            SFenterprise.sObject[] updateCurrencies = new SFenterprise.sObject[1];

            if (rbStandard.Checked)
            {
                
                SFenterprise.CurrencyType newCurrency = new CurrencyUpdater.SFenterprise.CurrencyType();

                newCurrency.Id = updatedId;

                newCurrency.ConversionRate = Convert.ToDouble(txtNewValue.Text);
                newCurrency.ConversionRateSpecified = true;

                updateCurrencies[0] = newCurrency;

            }
            else if (rbDated.Checked)
            {
                SFenterprise.DatedConversionRate newDatedCurrency = new CurrencyUpdater.SFenterprise.DatedConversionRate();

                newDatedCurrency.Id = updatedId;
                newDatedCurrency.ConversionRate = Convert.ToDouble(txtNewValue.Text);
                newDatedCurrency.ConversionRateSpecified = true;
                newDatedCurrency.StartDate = dateTimePicker1.Value.ToUniversalTime(); 
                newDatedCurrency.StartDateSpecified = true;
                newDatedCurrency.IsoCode = toCurISO;

                updateCurrencies[0] = newDatedCurrency;

            }

            setResultText("Updating SalesForce");
            SFenterprise.SaveResult[] sr = binding.update(updateCurrencies);

            txtResult.Text = sr.ToString();
            formActive(true);
        }