You need to sign in to do that
Don't have an account?
dev_jh
Executing API calls as another user
Hi all,
There is an interesting S-Control in the Apexchange to create a link and update the company´s currencies, it is called Currency Exchange Rate Updater 1.0.
We want to use it in our organization, the problem is that we want a user with no Admin rights to execute it and the Date Conversion data, for some odd reason, requires this priviledges.
The question is if it is possible to execute API calls as a different user to overcome this limitation and have the code execute successfully by specific users. Here is the code in question (an extract of it) in case it helps clarify:
Thanks,
J
There is an interesting S-Control in the Apexchange to create a link and update the company´s currencies, it is called Currency Exchange Rate Updater 1.0.
We want to use it in our organization, the problem is that we want a user with no Admin rights to execute it and the Date Conversion data, for some odd reason, requires this priviledges.
The question is if it is possible to execute API calls as a different user to overcome this limitation and have the code execute successfully by specific users. Here is the code in question (an extract of it) in case it helps clarify:
Code:
var newConversionRate = new sforce.SObject("DatedConversionRate"); newConversionRate.IsoCode = isoCurrencyCode; newConversionRate.ConversionRate = roundRate; newConversionRate.StartDate = today; //insert the record into SFDC try { var newConversionRateResult = sforce.connection.create([newConversionRate]);
Thanks,
J
To expose an apex method as a web service: http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_web_services_methods_exposing.htm
To call an apex method through the ajax proxy: http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_and_ajax.htm
Hi dev_jh. I have a related question to this... I am trying to use the original Salesforce Labs Currency Updater that you refer to but I cannot get it to work. We have Advanced Currency Management switched on and every time I click the link to update the currencies, I get a SFDC login screen and cannot progress further. Did you manage to overcome this?
I administer and org where we have around 80 currencies so getting this to work will be a real bonus! Any help you can provide would be greatly appreciated.
Cheers,
Gordon
Hi Gordon,
The script worked for me perfectly fine (when run by a user with the proper rights). I can only suggest you log a call with SF to try to get your specific issue resolved. Best of luck,
J