Salesforce – Web to Lead – Set Currency

This will probably be my shortest blog post ever but I came across a simple web to lead issue today. I wanted to default a currency in to a hidden field as the org that I was working in had multi-currency enabled. Not doing this would have meant that users would have resulted in bad data in the org due to figures being incorrect e.g a user enters 100 thinking its 100 EUR but actually its 100 GBP due to the currency of the default web to lead user.

As this cant be set via workflow rules, I was looking for a simple option rather than writing a trigger. I searched and this does not seem to be documented anywhere – you can add currency in to the form but we didnt want to let users choose as I knew what the currency should be for each form.

The code was simply:
[sourcecode language=”plain”]
<input type="hidden" id="currency" Name="currency" value="EUR">

The most confusing part of the process was the name of the field as Salesforce refers to it as Lead Currency and the in the API it would be CurrencyISOCode but neither of these worked. It turned out to be much more simple and the field name required is simply called ‘currency’.

Leave a Reply