Search code examples
c#web-servicessharepointcurrencycustom-action

What would be the best and easiest way of getting currency rates within SharePoint (Custom Actions) or C# project


I never came across any issue that required me to use external web services or interact with currency converter within a C# project or SharePoint Custom Action solution(Don't be afraid people its just C# project in visual studio).

I am not sure if this question is suitable for this site or not, but developers did you ever tried to get currency rates within your visual studio solutions if yes then how and which ? I think I can use web services but is that's the only way of doing it, and also which as I am not sure who provides free service and is stable as well.


Solution

  • There are currency rates services out there. However, the business and LOB rules should dictate how you actual do this.

    1. Free services are delayed by various time spans and may not be useful if you are doing real time. Conversions are usually to one standard currency, so to convert YEN to EUR you need to convert YEN => USD => EUR.
    2. Pay for services are as current as your network latency. These will usually also do conversions not based on a national standard (convert YEN => EUR without going through USD).
    3. If you are working on a system that sits behind firewalls, there may not be access to web services.
    4. If you only need approximations then a simple external XML or a table in a DB, that can be updated weekly or as required.
    5. In certain business cases the actual exchange rates is wrong: for example buying verses selling currency or very large multinational corporations which have options on a number currency markets so that they speculate or stabilize the currency.

    The trick to doing your own conversions is to have an internal constant currency to which all the other currencies are compared relatively. This way you only need ratios for all currencies to one currency (N:1) rather then all currencies to all currencies (N:N).