Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 154803

Forum Post: RE: How to set currency field

$
0
0
You can do this without plugin using JS or Business Rule. If you want to use a plugin, it's simple enough code: // Using Early binding decimal moneyValue = contact.Contains("new_money") ? contact.new_Money.Value : 0; // or Late Binding decimal moneyValue = contact.Contains("new_money") ? ((Money)(contact["new_money"])).Value : 0; if (moneyValue > 500) moneyValue = moneyValue * 2; // Call function to Update Money Value UpdateMoneyValue (Guid contactId, decimal moneyValue) // Function to Update Money Value private void UpdateMoneyValue(Guid contactId, decimal moneyValue) { Entity contact = new Entity("contact"); contact.Id = contactId; contact["new_money"] = new Money(moneyValue); service.Update(contact); // Inside try..catch block }

Viewing all articles
Browse latest Browse all 154803

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>