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
RaffiRaffi 

SOAP API call to update Currency Conversion Rate problem

I'm trying to update currency rates from our ERP through a SOAP API call to Salesforce. I'm getting update success returned and the timestamp on LastModifiedDate shows that the sObject are in fact being updated but the values do not actually change.  I'm using the following code:

 

List<sObject> ctList = new List<sObject>();

                while (queryResult.size > i)
                {
                    CurrencyType ct = (CurrencyType)queryResult.records[i];
                    CurrencyType c = new CurrencyType(); // contains fields to be updated
                    
                    if (ct.IsoCode == "USD")
                    {
                        c.Id = ct.Id;
                        c.ConversionRate = curr_USD;
                    }
                    if (ct.IsoCode == "EUR")
                    {
                        c.Id = ct.Id;
                        c.ConversionRate = curr_EUR;
                    }
                    ctList.Add(c);
                    i++;                    
                }

                updateSObject(ctList); // calls update metod to SFDC

 Any ideas why?

 

Thanks,

Best Answer chosen by Admin (Salesforce Developers) 

All Answers

_Prasu__Prasu_

Are you using "Advance Currency Management"? I think what you need to update is DateCurrencyRate in that case.

RaffiRaffi
Hi Prasanna,

No, we are not. I can update values in that table with Mass Update Anything for example and that works just fine so I am working with the correct sObject.

Raffi
Peter NicholsonPeter Nicholson
Im having the same problem with this.   What was the resolution?