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 }
↧