Let’s discuss the tips given by a Microsoft Dynamics CRM Services Team to solve “A currency is required if a value exists in a money field. Select a currency and try again”
Here is my code to set currency lookup -
And when I fill the amount field, I could not see any currency prefix in the field, so I getting below screenshot error.
The behavior I have seen that when we set currency lookup manually by hand, I can see the currency symbol/prefix correctly. So, I realize that something happening internally when I set currency lookup manually.
Here you can see when I set value currency fields is automatically set the currency symbol here in the field and its expected behavior.
I am bit surprised how to get rid-off this issue, I don’t want the user to set currency lookup manually and I found some unsupported way to set the currency symbol in the amount field. Then I thought that I would go with business rules to set the currency lookup, but I got the same error. So, business rules will not help us in this scenario.
Now we have left other two other options either plugin or workflow, first I moved ahead with workflow and I create workflow to set the currency lookup while saving and its working fine for me. But there is a problem, as you know if you have a multiple environment with multiple currencies and currency lookup GUID may not be the same for the entire environment. So, if I set currency lookup using the workflow you need to be make sure that the entire environment should be the same currency lookup GUID to work with workflow.
In my case I checked that I had a different currency GUID for the same currency in different environment. So, I decided to go with plugin. The plugin I register in Create event Pre operation to avoid additional update. Here is my plugin look like -
Screenshot of plugin steps -
In summary, when you have any currency type field in your form and if your application support multiple currency makes sure you set currency lookup value for the user manually or server side using plugin or workflow otherwise you may face this kind of issue.