Snippets Collections
id = record.get(columnOrder.indexOf("ID"));
info id;
image_list = List();
///////////////////////// link1 //////////////////////////
link1 = record.get(columnOrder.indexOf("link1"));
if(!isNull(link1))
{
  image_file = invokeurl
  [
    url: link1
    type: GET
  ];
  image_file.setParamName("image");
  image_list.add(image_file);
}
///////////////////////// link2 //////////////////////////
link2 = record.get(columnOrder.indexOf("link2"));
if(!isNull(link2))
{
  image_file = invokeurl
  [
    url: link2
    type: GET
  ];
  image_file.setParamName("image");
  image_list.add(image_file);
  info image_list;
  response = invokeurl
  [
    url : "https://inventory.zoho.com/api/v1/items/" + id + "/images?organization_id=" + organizationID
    type: POST
    files:image_list
    connection:"zohoinventory"
  ];
  info response;
}
image_file = invokeurl
[
  url: link1
  type: GET
];
info image_file;
image_file.setParamName("image");
response = invokeurl
[
  url : "https://inventory.zoho.com/api/v1/items/" + id + "/image?organization_id=" + organizationID
  type: POST
  files:image_file
  connection:"zohoinventory"
];
info response;
Deal_Details = zoho.crm.getRecordById("Deals",deal_id);
Deal_Name = Deal_Details.get("Deal_Name");
Deal_Number = Deal_Details.get("Deal_Number");
//===================================================================================//
searchParam = {"reference_number":Deal_Number};
related_purchase_orders = zoho.books.getRecords("purchaseorders","689149759",searchParam);
info related_purchase_orders;
count = 0;
Total_of_all = 0.0;
if(related_purchase_orders.get("purchaseorders").size() > 0)
{
	responseXML = "<record>";
	for each  purchase_order in related_purchase_orders.get("purchaseorders")
	{
		purchaseorder_number = purchase_order.get("purchaseorder_number");
		created_date = purchase_order.get("date");
		status = purchase_order.get("status");
		vendor_name = purchase_order.get("vendor_name");
		total = purchase_order.get("total");
		Total_of_all = Total_of_all + total;
		po_id = purchase_order.get("purchaseorder_id");
		html = "<a href='www.google.com'>click here</a>";
		//===================================================================================//
		responseXML = responseXML + "<row no='" + count + "'>";
		responseXML = responseXML + "<FL val='PO Number'>" + purchaseorder_number + "</FL>";
		responseXML = responseXML + "<FL val='Status'>" + status.proper() + "</FL>";
		responseXML = responseXML + "<FL val='Vendor'>" + vendor_name.replaceAll("[\"#%&+;<=>\[\]^`(){}|~]","") + "</FL>";
		responseXML = responseXML + "<FL val='Total'>$ " + total + "</FL>";
		responseXML = responseXML + "<FL val='Created Date'>" + created_date + "</FL>";
		// 				responseXML = responseXML + "<FL val='PO Link'>https://books.zoho.com/app#/purchaseorders/" + po_id + "</FL>";
		responseXML = responseXML + "<FL val='PO Link' link='true' url='https://books.zoho.com/app#/purchaseorders/" + po_id + "'>Open</FL>";
		responseXML = responseXML + "</row>";
		count = count + 1;
	}
	responseXML = responseXML + "</record>";
}
else
{
	responseXML = "";
	responseXML = responseXML + "<record><error>=><message>There are no POs found against this Deal!</message></error></record>";
}
return responseXML;
/////////////// Inserting Record into Middle Table ///////
				importList = List();
				for each  id in uniqueIDs
				{
					if(!isNull(id))
					{
						rowMap = Map();
						rowMap.put("Unique String",id);
						rowMap.put("Invoice ID",invoiceID);
						importList.add(rowMap);
					}
				}
				////////////////////////////////////////////////////////////////
				viewName2 = "Invoices Centre Table";
				paramsMap = Map();
				paramsMap.put("ZOHO_ACTION","IMPORT");
				paramsMap.put("ZOHO_OUTPUT_FORMAT","JSON");
				paramsMap.put("ZOHO_ERROR_FORMAT","JSON");
				paramsMap.put("ZOHO_API_VERSION","1.0");
				//=========================================
				//ACTION SPECIFIC PARAMS
				paramsMap.put("ZOHO_IMPORT_DATA",importList);
				paramsMap.put("ZOHO_IMPORT_FILETYPE","JSON");
				paramsMap.put("ZOHO_IMPORT_TYPE","UPDATEADD");
				paramsMap.put("ZOHO_AUTO_IDENTIFY","TRUE");
				paramsMap.put("ZOHO_ON_IMPORT_ERROR","SKIPROW");
				paramsMap.put("ZOHO_CREATE_TABLE","false");
				paramsMap.put("ZOHO_MATCHING_COLUMNS","Unique String");
				// ==========================================
				importInvoicedItems = invokeurl
				[
					url :"https://analytics.zoho.com//api/" + encodeUrl(email) + "/" + encodeUrl(workspaceName) + "/" + encodeUrl(viewName2) + ""
					type :POST
					parameters:paramsMap
					connection:"zoho_apps_connection"
				];
				info "Adding to Middle Table: " + importInvoicedItems;
SELECT DISTINCT
 "Accounts"."Id" AS "Account ID",
 "Accounts"."Account Name" AS "Account Name",
 "Promoter"."Id" AS "Promoter ID",
 REPLACE("Promoter"."Promoter Name", ',', '') AS "Promoter Name",
 if(SUM(CASE
 WHEN DATE_FORMAT("Promoters Vs Invoices"."Invoice Date", '%Y-%m')  = DATE_FORMAT(today(), '%Y-%m') THEN "Promoters Vs Invoices"."Total"
 ELSE 0
 END)  > 0, 'Invoiced', if(SUM("Check Transactions"."Previous Month Contribution")  > 0, 'Invoice Missing', 'No Contributions')) AS "Current Month Billing Status",
 SUM(CASE
 WHEN DATE_FORMAT("Promoters Vs Invoices"."Invoice Date", '%Y-%m')  = DATE_FORMAT(today(), '%Y-%m') THEN "Promoters Vs Invoices"."Total"
 ELSE 0
 END) AS "Invoiced Current Month",
 SUM(CASE
 WHEN DATE_FORMAT("Promoters Vs Invoices"."Invoice Date", '%Y-%m')  = DATE_FORMAT(today() -INTERVAL 1 MONTH, '%Y-%m') THEN "Promoters Vs Invoices"."Total"
 ELSE 0
 END) AS "Invoiced Last Month",
 SUM(CASE
 WHEN DATE_FORMAT("Promoters Vs Invoices"."Invoice Date", '%Y-%m')  = DATE_FORMAT(today() -INTERVAL 2 MONTH, '%Y-%m') THEN "Promoters Vs Invoices"."Total"
 ELSE 0
 END) AS "Invoiced Two Months Ago"
FROM  "Accounts"
JOIN "Promoter" ON "Promoter"."Account"  = "Accounts"."Id" 
LEFT JOIN "Promoters Vs Invoices" ON "Promoters Vs Invoices"."Promoter ID"  = "Promoter"."Id"
 AND	"Promoters Vs Invoices"."Invoice Date"  >= DATE_SUB(start_day(month, today()), INTERVAL 3 MONTH) 
LEFT JOIN(	SELECT
 "Promoter Id",
 SUM("Contribution Amount") as "Overall Contributions",
 SUM(CASE
 WHEN DATE_FORMAT("Transaction Date", '%Y-%m')  = DATE_FORMAT(today() -INTERVAL 1 MONTH, '%Y-%m') THEN "Contribution Amount"
 ELSE 0
 END) AS "Previous Month Contribution"
	FROM  "AWS Transactions - Final (3 Hour Sync)" 
	GROUP BY  "Promoter Id" 
) AS  "Check Transactions" ON "Check Transactions"."Promoter Id"  = "Promoter"."Id"  
WHERE "Accounts"."Billing Cycle"  != ''
 AND	"Accounts"."Auto Invoice"  = 'Yes'
 AND	("Promoter"."Promoter Status"  = 'Live'
 OR	("Promoter"."Promoter Status"  = 'Cancelled'
 AND	"Promoter"."Cancellation/Pause Date"  is not null))
 AND	"Promoter"."Bill To"  is not null
 AND	"Check Transactions"."Overall Contributions"  > 0
GROUP BY "Accounts"."Id",
 "Accounts"."Account Name",
 "Promoter"."Id",
  "Promoter"."Promoter Name" 
ORDER BY "Accounts"."Account Name",
 replace("Promoter"."Promoter Name", ',', '')
	time_and_zone = reset_date_time.getSuffix("T");
	reset_date = reset_date_time.getPrefix("T");
// 	info time_and_zone;
	//////// calculating time /////
	if(frequency == "Weekly")
	{
	 	next = reset_date.addDay(7);
	}else if (frequency == "Monthly")
	{
		nex = reset_date.addMonth(1);
	}else if (frequency == "Quarterly") 
    {
		next = reset_date.addMonth(3);
    }
	else if ( frequency == "Yearly" ) 
    {
		next = reset_date.addYear(1);
    }
	
	end_date_time = nex.toString("yyyy-MM-dd")+"T"+time_and_zone;
// iteration_list = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
searchValue = {"contactId":contact_Id, "createdTimeRange":reset_date_time +","+end_date_time }; 
response = zoho.desk.searchRecords(organization_id, "tickets", searchValue, 0, 1000, "zoho_desk");
delete from Community_Referral[ID == referral];
com_referral = Community_Referral[ID == referral_Id];
com_referral.Community=lineItem.Community.toNumber();
com_referral.Referral_Emails=lineItem.Community_Emails;
com_referral.Status=lineItem.Status;
com_referral.Referral_Sent=lineItem.Referral_Sent;
com_referral.Last_Update_Sent=lineItem.Last_Update_Sent;
com_referral.Include_Updates=lineItem.Include_Updates;
com_referral.Notes=lineItem.Notes;
insert_record = insert into Community_Referral
[
  Added_User=zoho.loginuser
  Community=lineItem.Community
  Referral_Emails=lineItem.Community_Emails
  Deal=input.Deal
  Status=lineItem.Status
  Referral_Sent=lineItem.Referral_Sent
  Last_Update_Sent=lineItem.Last_Update_Sent
  Include_Updates=lineItem.Include_Updates
  Notes=lineItem.Notes
];
for each  referral in related_referrals
{
	row1 = Update_Deal_Referrals.Referrals();   /// Referrals is subform name
	row1.Community=referral.Community;
	row1.Community_Emails=referral.Referral_Emails;
	row1.Status=referral.Status;
	row1.Referral_Sent=referral.Referral_Sent;
	row1.Last_Update_Sent=referral.Last_Update_Sent;
	row1.Include_Updates=referral.Include_Updates;
	row1.Notes=referral.Notes;
	row1.Referral_ID=referral.ID;
	rowcollection = Collection();
	rowcollection.insert(row1);
	input.Referrals.insert(rowcollection);
}
from_map = Map();
from_map.put("user_name", owner_name);
from_map.put("email", owner_email);

////
to_list = List();
for each person in email_list
{
  to_map = Map();
  to_map.put("email", person);
  to_list.add(to_map);
} 
//// CRM template id ///\
template = Map();
template.put("id", "4202165000088355038");

/// 

param = Map();
param.put("from", from_map);
param.put("to", to_list);
param.put("template", template);
param_list = List();
param_list.add(param);
// 
data = Map();
data.put("data", param_list);
info data;
sent_mail = invokeUrl
[
  url: "https://www.zohoapis.com/crm/v6/Deals/"+deal_id+"/actions/send_mail"
  type: POST
  parameters: data.toString()
  connection: "zoauth"
];
info sent_mail;
task_map = Map();
task_map.put("Subject","Contact nick name is missing.");
task_map.put("Description","Please add the nickname of the selected contact for this task, so that the system can send a notification about the unchanged deal within 90 days to this contact.");
task_map.put("Deal_Priority",true);
task_map.put("Who_Id",contact_Id);
task_map.put("Due_Date",zoho.currentdate.addDay(5));
task_map.put("Priority","? Normal (THIS WEEK)");
task_map.put("What_Id",deal_Id);
task_map.put("Owner",deal_owner);
task_map.put("$se_module","Deals");
create_name_task = zoho.crm.createRecord("Tasks",task_map);
info "Creating nickname missing task = " + create_name_task;
deleteRecordMap = Map();
deleteRecordMap = {"module":"Leads","id":leadId};
deleteResp = zoho.crm.invokeConnector("crm.delete",deleteRecordMap);
info deleteResp;
options = map();
optionlist = list();
optionlist.add("workflow");
options.put("trigger",optionlist);
updateRec= zoho.crm.updateRecord(module_name, updatemap, options, connection);
options = map();
optionlist = list();
optionlist.add("workflow");
options.put("trigger",optionlist);
updateRec= zoho.crm.updateRecord(module_name, updatemap, options, connection);
criteria = "email:equals:"+vendor_email;
response = zoho.crm.searchRecords("users", criteria);
info response;
	/////////////// Invoices ///////////////
	viewName = "Invoices To Create in Zoho Books";
	email = "marc@medipro.com";
	workspaceName = "Zoho One Analytics";
	organization_id = "650419754";
	paramsMap = Map();
	paramsMap.put("ZOHO_ACTION","EXPORT");
	paramsMap.put("ZOHO_OUTPUT_FORMAT","JSON");
	paramsMap.put("ZOHO_ERROR_FORMAT","JSON");
	paramsMap.put("ZOHO_API_VERSION","1.0");
	///////////////////////////////////// Criteria /////////////////////////////////
	// 	paramsMap.put("ZOHO_SQLQUERY","select * from \"" + viewName + "\" LIMIT 50 OFFSET " + offset + "");
	paramsMap.put("ZOHO_SQLQUERY","select * from \"" + viewName + "\" ORDER BY \"Customer ID\" LIMIT 50 OFFSET " + offset + "");
	fetchMatchinReport = invokeurl
	[
		url :"https://analytics.zoho.com//api/" + encodeUrl(email) + "/" + encodeUrl(workspaceName) + "/" + encodeUrl(viewName)
		type :POST
		parameters:paramsMap
		connection:"zoho_apps_connection"
	];
	info fetchMatchinReport;
	Rows = fetchMatchinReport.get("response").get("result").get("rows");
	columnOrder = fetchMatchinReport.get("response").get("result").get("column_order").toList(",");
	for each  record in Rows
	{
		customer_id = record.get(columnOrder.indexOf("Xero Books Customer ID"));
		recordMap = Map();
		recordMap.put("customer_id",customer_id);
		recordMap.put("date",record.get(columnOrder.indexOf("Xero Invoice Date")));
		recordMap.put("due_date",record.get(columnOrder.indexOf("Xero Due Date")));
    }
	accountCode = 202;
	searchMap = Map();
	searchMap.put("account_code",accountCode);
	///
	fetch = zoho.books.getRecords("chartofaccounts","20091181966",searchMap,"zoho_books");
	info fetch;
viewName = "Billing Project Report 1 (Transaction Details)";
			workspaceName = "Zoho One Analytics";
			email = "systems@gifttrees.com";
			paramsMap = Map();
			paramsMap.put("ZOHO_ACTION","EXPORT");
			paramsMap.put("ZOHO_OUTPUT_FORMAT","CSV");
			paramsMap.put("ZOHO_ERROR_FORMAT","JSON");
			paramsMap.put("ZOHO_API_VERSION","1.0");
			// 		offSet = 0;
			///////////////////////////////////// Criteria /////////////////////////////////
			paramsMap.put("ZOHO_SQLQUERY","select \"Transaction ID\",\"Invoice ID\",\"Invoice Date\",\"Unique Batch ID\",\"Contribution Amount\",\"Price Per Tree\" from \"" + viewName + "\" where \"Unique Batch ID\"='" + uniqueBatchID + "' order by \"Transaction ID\"  LIMIT 25000 OFFSET " + offseta + "");
			fetchbillingdata = invokeurl
			[
				url :"https://analytics.zoho.eu//api/" + encodeUrl(email) + "/" + encodeUrl(workspaceName) + "/" + encodeUrl(viewName)
				type :POST
				parameters:paramsMap
				connection:"zoho_analytics1"
			];
			// 			info fetchbillingdata;
			name = offseta.toNumber() + "-" + to + "-" + "Update.csv";
			to = to + 25000;
			csv_file = fetchbillingdata.toString().tofile(name);
			csv_file.setParamName("file");
		blueprint_details = invokeurl
		[
			url: "https://www.zohoapis.com/crm/v5/Deals/"+DealID+"/actions/blueprint"
			type: GET
			connection:"zoho_crm"
		];
	// 	info blueprint_details;
		blueprint = Map();
		blueprint.put("transition_id","6051205000002261178");
	// 	blueprint.put("data",dataMap);
		blueprintList = List();
		blueprintList.add(blueprint);
		param = Map();
		param.put("blueprint",blueprintList);
		update_blueprint_stage = invokeurl
		[
		url :"https://www.zohoapis.com/crm/v5/Deals/" + DealID + "/actions/blueprint"
		type :PUT
		parameters:param.toString()
		connection:"zoho_crm"
		];
		info update_blueprint_stage;
// 1. You need to use tags in the Template
/// Here is link for tags: https://help.zoho.com/portal/en/kb/zoho-sign/user-guide/sending-a-document/articles/automatic-field-addition-in-zoho-sign

dealLDetails = zoho.crm.getRecordById("Deals",DealID);
// info dealLDetails;
// getAllFieldsResponse = invokeurl
// [
// 	url :"https://writer.zoho.com/api/v1/documents/flo7ld4ba09726a694424994054acbb636e81/fields"
// 	type :GET
// 	connection:"zoho_crm"
// ];
// info getAllFieldsResponse;
fieldTextData = Map();
fieldTextData.put("Deal_Name",dealLDetails.get("Deal_Name"));
fieldTextData.put("Stage",dealLDetails.get("Stage"));
fieldTextData.put("Owner",dealLDetails.get("Owner").get("name"));
contact_roles = zoho.crm.getRelatedRecords("Contact_Roles","Deals",DealID);
// info contact_roles;
contact_List = List();
count = 0;
signerList = List();
for each  contact in contact_roles
{
	count = count +1;
	name = contact.get("Full_Name");
	contact_map = Map();
	contact_map.put("Contact_Roles.Full_Name",name);
	contact_map.put("Contact_Roles.First_Name", count);
	signerMap = Map();
	signerMap.put("recipient_"+count, contact.get("Email"));
	signerMap.put("action_type", "sign");
	signerMap.put("language","en");
	contact_List.add(contact_map);
	signerList.add(signerMap);
}
fieldTextData.put("Contact_Roles",contact_List);
data_mp = Map();
data_mp.put("data",fieldTextData);
params = Map();
params.put("merge_data",data_mp);
params.put("service_name","zohosign");
params.put("signer_data",signerList);
params.put("sign_in_order","true");
// optional
params.put("message","Please find the document to be signed here");
//optional
params.put("reminder_period","15");
//optional
params.put("set_expire","30");
//optional
documentid = "flo7ld4ba09726a694424994054acbb636e81";
templatename = "Test Shareholder Agreement";
params.put("filename",templatename);
url = "https://zohoapis.com/writer/api/v1/documents/" + documentid + "/merge/sign";
info params;
/////////////////////////////
documentObj = invokeurl
[
	url :url
	type :POST
	parameters:params
	connection:"zoho_crm"
];
info documentObj;
getRoles = invokeurl
	[
	url: "https://www.zohoapis.com/crm/v3/Contacts/roles/"+contact.get("Contact_Role")
	type: GET
	connection:"zoho_crm"
	];
	info getRoles;
	contact_role_name = getRoles.get("contact_roles").get(0).get("name");
// path = "https://forms.zoho.com/api/form/OnboardingForm/formperma/RcHkbHGBh8_5yjVX6sSfhb2OfIHid-3SyJAZVPOuZns/resthookdownload?filepath=/OnboardingForm/FileUpload11/1715686347747_Legal_Rep_Rep1_first_Proof_of_address.png";

passport_files = rep.get("FileUpload10");
			for each  file in passport_files
			{
				path = file.get("path");
				getFile = invokeurl
				[
					url :path
					type :GET
					connection:"zoho_form"
				];
				info "Getting file = " + getFile;
				getFile.setParamName("file");
				attach_file = invokeurl
				[
					url :"https://www.zohoapis.com/crm/v3/Contacts/" + contact_id + "/Attachments"
					type :POST
					files:getFile
					connection:"zoho_crm"
				];
				info "Attaching files = " + attach_file;
			}
mail_merge_template = Map();
mail_merge_template.put("name","Copy Shareholder Agreement");
download_mail_merge = Map();
download_mail_merge.put("mail_merge_template", mail_merge_template);
download_mail_merge.put("output_format", "pdf");
download_mail_merge.put("file_name", "Test Shareholder Agreement");

param = Map();
param.put("download_mail_merge", download_mail_merge.toList());

download_pdf = invokeurl
[
	url: "https://www.zohoapis.com/crm/v6/Deals/"+DealID+"/actions/download_mail_merge"
	type: POST
	parameters: param.toString()
	connection:"zoho_crm"
];

info download_pdf;
download_pdf.setParamName("file");

/////////// Send Using Zoho Sign ////////


action_list = List();
action = Map();
action.put("action_type", "SIGN");
action.put("recipient_email", "roy@gmail.com");
action.put("recipient_name", "Roy");
action.put("verify_recipient", true);
action.put("verification_type", "EMAIL");
action_list.add(action);
request = Map();
request.put("request_name", "Test Shareholer Agreement");
request.put("is_sequential", false);
request.put("actions", action_list);
request.put("email_reminders", true);
request.put("reminder_period", 2);
requests = Map();
requests.put("requests", request);
data = Map();
data.put("data", requests);
info data;
/////
send_doc = invokeurl
[
	url: "https://sign.zoho.com/api/v1/requests"
	type: POST
	parameters: data
	files: download_pdf
	connection: "zoho_sign"
];

info send_doc;
recipient = Map();
recipient.put("type", "email");
recipient.put("value", "roy@gmail.com");
/////////////////////////
signer = Map();
signer.put("recipient_name", "Rehmat");
signer.put("action_type", "sign");
signer.put("recipient", recipient);
//////////////////
signers = List();
signers.add(signer);
///////////////////
mail_merge_template = Map();
mail_merge_template.put("name", "Copy Shareholder Agreement");
//////////////////
sign_mail_merge = Map();
sign_mail_merge.put("file_name", "Agreement");
sign_mail_merge.put("sign_in_order", false);
sign_mail_merge.put("mail_merge_template", mail_merge_template);
sign_mail_merge.put("signers", signers);
///////////
param = Map();
param.put("sign_mail_merge", sign_mail_merge.toList());
///////////
info param;

send_doc = invokeurl
[
	url: "https://www.zohoapis.com/crm/v6/Deals/"+DealID+"/actions/sign_mail_merge"
	type: POST
	parameters: param.toString()
	connection: "zoho_crm"
];

info send_doc;
		contact_map = Map();
		contact_map.put("First_Name	",rep.get("Name1_First"));
		contact_map.put("Last_Name",rep.get("Name1_Last"));
		contact_map.put("Mailing_City",rep.get("Address3_City"));
		contact_map.put("Phone",rep.get("PhoneNumber2"));
		contact_map.put("Mailing_State",rep.get("Address3_Region"));
		contact_map.put("Mailing_Zip",rep.get("Address3_ZipCode"));
		contact_map.put("Mailing_Street",rep.get("Address3_AddressLine1"));
		contact_map.put("Mailing_Street_Line_2",rep.get("Address3_AddressLine2"));
		contact_map.put("Email",rep.get("Email2"));
		contact_map.put("Mailing_Country",rep.get("Address3_Country"));
		contact_map.put("Social_Security_Number",rep.get("SingleLine4"));
		contact_map.put("Passport_Number",rep.get("SingleLine5"));
		contact_map.put("Is_the_legal_representative_an_American_citizen",rep.get("Dropdown3"));
		contact_map.put("Title",rep.get("SingleLine7"));
		contact_map.put("Occupation",rep.get("SingleLine8"));
		contact_map.put("Account_Name",account_id);
		// 		info contact_map;
		create_contact = zoho.crm.createRecord("Contacts",contact_map);
		info create_contact;
		if(create_contact.containKey("id"))
		{
			contact_id = create_contact.get("id");
			//////// Get Roles Ids /////
			// 		get_contact_roles_ids = invokeurl
			// 		[
			// 			url :"https://www.zohoapis.com/crm/v4/Contacts/roles"
			// 			type :GET
			// 			connection:"zoho_crm"
			// 		];
			// 		info get_contact_roles_ids;
			////////////////////////////////////////////////////
			//////////////// Add Contact role to a specific deal ////////
			role_map = Map();
			role_map.put("name","Legal Representative");
			role_map.put("id","6051205000000006871");
			Contact_Role = Map();
			Contact_Role.put("Contact_Role",role_map);
			data = Map();
			data.put("data",Contact_Role.toList());
          //////// 6051205000001977001 is Contact Id /////////
			add_contact_role_to_deal = invokeurl
			[
				url :"https://www.zohoapis.com/crm/v4/Deals/6051205000001947026/Contact_Roles/6051205000001977001"
				type :PUT
				parameters:data.toString()
				connection:"zoho_crm"
			];
			info add_contact_role_to_deal;
        }
if(input.Start_Date_Time != null && input.Service_Lookup != null)
{
	getServiceDetails = Add_Services[ID == input.Service_Lookup];
	serviceMinutes = getServiceDetails.Service_Time;
	input.End_Date_Time = input.Start_Date_Time.addMinutes(serviceMinutes);
}
<iframe src="https://workdrive.zohoexternal.com/embed/bjw0e76ce7549f555496596b428147038b51d?toolbar=false&appearance=light&themecolor=green" scrolling="no" frameborder="0" allowfullscreen=true width="800" height="520" ></iframe>
<variable> = <dateTimeValue>.addMinutes(<numberOfMins>);
star

Sun Oct 06 2024 20:32:58 GMT+0000 (Coordinated Universal Time)

#deluge
star

Sun Oct 06 2024 19:48:57 GMT+0000 (Coordinated Universal Time)

#deluge
star

Tue Oct 01 2024 12:15:32 GMT+0000 (Coordinated Universal Time)

#deluge
star

Mon Sep 16 2024 13:11:58 GMT+0000 (Coordinated Universal Time)

#deluge
star

Fri Aug 23 2024 15:08:13 GMT+0000 (Coordinated Universal Time)

#deluge
star

Thu Jul 11 2024 12:08:24 GMT+0000 (Coordinated Universal Time)

#deluge
star

Wed Jun 26 2024 12:24:39 GMT+0000 (Coordinated Universal Time)

#deluge
star

Wed Jun 26 2024 12:23:54 GMT+0000 (Coordinated Universal Time)

#deluge
star

Wed Jun 26 2024 12:22:38 GMT+0000 (Coordinated Universal Time)

#deluge
star

Wed Jun 26 2024 12:19:46 GMT+0000 (Coordinated Universal Time)

#deluge
star

Tue Jun 25 2024 13:03:06 GMT+0000 (Coordinated Universal Time)

#deluge
star

Mon Jun 24 2024 13:31:10 GMT+0000 (Coordinated Universal Time)

#deluge
star

Fri Jun 21 2024 10:39:40 GMT+0000 (Coordinated Universal Time)

#deluge
star

Wed Jun 12 2024 10:57:31 GMT+0000 (Coordinated Universal Time)

#deluge
star

Wed Jun 12 2024 10:57:31 GMT+0000 (Coordinated Universal Time)

#deluge
star

Fri Jun 07 2024 11:32:25 GMT+0000 (Coordinated Universal Time)

#deluge
star

Fri May 31 2024 17:15:47 GMT+0000 (Coordinated Universal Time)

#deluge
star

Fri May 31 2024 12:08:03 GMT+0000 (Coordinated Universal Time)

#deluge
star

Fri May 24 2024 14:57:56 GMT+0000 (Coordinated Universal Time)

#deluge
star

Wed May 22 2024 18:16:31 GMT+0000 (Coordinated Universal Time)

#deluge
star

Fri May 17 2024 12:04:57 GMT+0000 (Coordinated Universal Time)

#deluge
star

Wed May 15 2024 16:39:39 GMT+0000 (Coordinated Universal Time)

#deluge
star

Wed May 15 2024 11:22:42 GMT+0000 (Coordinated Universal Time)

#deluge
star

Mon May 13 2024 14:55:28 GMT+0000 (Coordinated Universal Time)

#deluge
star

Fri May 10 2024 16:31:22 GMT+0000 (Coordinated Universal Time)

#deluge
star

Wed May 08 2024 13:15:12 GMT+0000 (Coordinated Universal Time)

#deluge #zoho
star

Fri Jun 09 2023 04:52:48 GMT+0000 (Coordinated Universal Time) https://creatorapp.zoho.com/sapphireelitetech/datebook#Form:Book_an_Appointment

#deluge #zoho #delugescript #creator #workflow
star

Wed Mar 22 2023 05:38:14 GMT+0000 (Coordinated Universal Time) https://workdrive.zoho.com/home/idbg0d870c6f01e9d41488cabb283a80c8cb2/teams/idbg0d870c6f01e9d41488cabb283a80c8cb2/ws/q03c8bb37e56c523d4160ac6d8fc798a8f0c5/folders/bjw0e53230348a18f473d8c579ba6e012124d

#deluge
star

Wed Mar 22 2023 05:09:14 GMT+0000 (Coordinated Universal Time) https://www.zoho.com/deluge/help/functions/datetime/addminutes.html

#deluge

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension