Hello,
We are trying to transfer tags from deals to accounts. Example- We create a deal and link it to an account. In the DEALS module, we tag it "specific". We want that "specific" tag to move over to ACCOUNTS also. That way we don't have to re-tag things in ACCOUNTS when we already tagged the DEAL. Is this possible? I tried the code below but wasn't sure how to edit it to include the modules we needed to merge.
acctinfo = zoho.crm.getRecordById("Accounts",acctId);
tagname = "";
tagvalue = ifnull(acctinfo.get("Tag"),"");
if(tagvalue != "")
{
for each ele in tagvalue
{
tagname = tagname + ele.get("name") + ",";
}
}
newtagname = tagname.removeLastOccurence(",").trim();
mp = Map();
mp.put("tag_names",newtagname);
relatedContacts = zoho.crm.getRelatedRecords("Contacts", "Accounts", acctId);
if(relatedContacts.size()>0)
{
for each contact in relatedContacts
{
contId = contact.get("id");
response = invokeurl
[
url :"https://www.zohoapis.com/crm/v2/Contacts/" + contId + "/actions/add_tags?"
type :POST
parameters:mp
connection: "connectionname"
];
info response;
}
}