Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //gather general details
- potentialDetails = zoho.crm.getRecordById("Pipeline",potentialId);
- followup = potentialDetails.get("FollowUp_Schedule");
- info "followup Schedule: " + followup;
- type = potentialDetails.get("Type");
- info "type: " + type;
- potentialOwnerId = potentialDetails.get("Owner").get("id");
- info "deal owner id: " + potentialOwnerId;
- personId = potentialDetails.get("Person").get("id");
- info "contact id: " + personId;
- // find associated transition
- blueprint = invokeurl
- [
- url :"https://www.zohoapis.com/crm/v2/Pipeline/" + potentialId + "/actions/blueprint"
- type :GET
- connection:"crm_all"
- ];
- info "blueprint: " + blueprint;
- transitions = blueprint.get("blueprint").get("transitions");
- info "Transitions: " + transitions;
- info "followup Schedule: " + followup;
- for each transition in transitions
- {
- transitionName = transition.get("name");
- info "transition name: " + transitionName;
- if(transitionName == followup)
- {
- transitionId = transition.get("id");
- }
- }
- info "transition id: " + transitionId;
- //put new transition into record
- if(!transitionId.isNull())
- {
- dataMap = Map();
- dataMap.put("Notes","Updated via deluge");
- blueprint1 = Map();
- blueprint1.put("transition_id",transitionId);
- blueprint1.put("data",dataMap);
- blueprintList = List();
- blueprintList.add(blueprint1);
- param = Map();
- param.put("blueprint",blueprintList);
- response = invokeurl
- [
- url :"https://www.zohoapis.com/crm/v2/Pipeline/" + potentialId + "/actions/blueprint"
- type :PUT
- parameters:param.toString()
- connection:"crm_all"
- ];
- info response;
- }
Advertisement
Add Comment
Please, Sign In to add comment