Can't use invokeurl in Validation rule function?
Hi, I've got a validation rule looking up an error table to return the error message, but it's not working.
The error is:
Oops! Something went wrong.
Please try again or check out for following reasons:
Please check your function for any possible failed case
Please check your function for any loop that might take time to respond
See code:
- entityMap = crmAPIRequest.toMap().get("record");
- wIfValid = True;
- wErrorNo = 0;
- zStage = entityMap.get("Stage");
- response = Map();
- if(zStage == "400")
- {
- wIfValid = False;
- wErrorNo = 1;
- mErrorParams = Map();
- mErrorParams.put("wErrorNo",wErrorNo);
- resp = invokeurl
- [
- url :"https://www.zohoapis.com/crm/v2/functions/devvalderrortable/actions/execute?auth_type=oauth"
- type :GET
- parameters:mErrorParams
- connection:"crmall"
- ];
- }
- if(wIfValid == True)
- {
- response.put('status','success');
- }
- else if(wIfValid == False)
- {
- response.put('status','Failed');
- response.put('message',resp);
- }
- return response;
Thanks
Levi