Last active
August 17, 2022 10:48
-
-
Save cliffordp/9bfecbfbde2e881dfdf855b45ce65d2b to your computer and use it in GitHub Desktop.
Zoho CRM Deals - Deposit is positive and not more than Total Amount
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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