I sometimes need to conditionally tag a record when debugging my Deluge code. Here is a simple "wrapper'-style function, that saves a few lines of code (which makes long chunks of code easier to read).
- tag1 = Map();
- tag1.put("name",tag_name);
- tags_list = List();
- tags_list.add(tag1);
- param = Map();
- param.put("tags",tags_list);
- recordIDs = List();
- recordIDs.add(record_id);
- param.put("ids",recordIDs);
- res = invokeurl
- [
- url :"https://www.zohoapis.com/crm/v3/" + module_name + "/actions/add_tags"
- type :POST
- parameters:param.toString()
- connection:"crm_modules_all"
- ];
- return res;
Call the function this way:
- standalone.Tag_Record("Deals",deal_id, "Sample Tag Text");
I use this often enough that "saving" 17 lines of code is helpful to me in preserving maintainability.