Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Zoho CRM Deals - Deposit is positive and not more than Total Amount
entityMap = crmAPIRequest.toMap().get("record");
/*
The example below demonstrates how a field’s value (email) can be obtained from a MAP object. Here, entityMap - Map Object, Email - Field's API name
Sample entityMap= {'Email': 'xxx@xxx.com', 'Last_Name': 'xxx'};
*/
amount = entityMap.get("Amount");
deposit = entityMap.get("Deposit");
sendmail
[
from :zoho.adminuserid
to :"tko+okcrete@tourkick.com"
subject :"DealDepositAmountIsValid()"
message :entityMap.toString()
]
response = Map();
// Messages must be 100 characters or less.
if(deposit < 0)
{
response.put('status','error');
response.put('message','Deposit must be positive.');
}
else if(deposit > amount)
{
response.put('status','error');
response.put('message','Amount must be greater than Deposit.');
}
else
{
response.put('status','success');
}
return response;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment