This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| message_record = zoho.crm.getRecordById("twiliosmsextension0__Sent_SMS",message_id); | |
| if(lead_id != null) | |
| { | |
| update_payload = {"Last_SMS_received":message_record.get("Message")}; | |
| update_resp = zoho.crm.updateRecord("Leads",lead_id,update_payload); | |
| } | |
| if(contact_id != null) | |
| { | |
| update_payload = {"Last_SMS_received":message_record.get("Message")}; | |
| update_resp = zoho.crm.updateRecord("Contacts",contact_id,update_payload); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lead_record = zoho.crm.getRecordById("Leads",lead_id); | |
| mobile = lead_record.get("Mobile"); | |
| mobile_without_numeric_characters = mobile.replaceAll("[^\\d+]*",""); | |
| // example: (03) 1245 1(11) | |
| // desired result: 031245111 | |
| country = lead_record.get("Country"); | |
| if(country == "Australia") | |
| { | |
| country_code = "+61"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| outstanding_tasks_to_close = zoho.crm.getRelatedRecords("Tasks","Leads",lead_id); | |
| for each task in outstanding_tasks_to_close | |
| { | |
| if(task.get("Status") != "Completed") | |
| { | |
| update_payload = {"Status":"Completed"}; | |
| update_resp = zoho.crm.updateRecord("Tasks",task.get("id"),update_payload); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| call_record = zoho.crm.getRecordById("Calls",call_id); | |
| caller_phone_number = call_record.get("Subject").getSuffix("Missed call from "); | |
| new_lead_data = {"First_Name":"Unknown","Last_Name":"From missed call from " + caller_phone_number,"Phone":caller_phone_number,"Lead_Source":"Missed Call from unknown number"}; | |
| create_resp = zoho.crm.createRecord("Leads",new_lead_data); | |
| new_lead_id = create_resp.get("id"); | |
| update_call_payload = {"What_Id":new_lead_id,"$se_module":"Leads"}; | |
| update_resp = zoho.crm.updateRecord("Calls",call_id,update_call_payload); | |
| info update_resp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| contact_data = zoho.crm.getRecordById("Contacts", contact_id); | |
| owner_id = contact_data.get("Owner").get("id"); | |
| user_response = zoho.crm.getRecordById("users", owner_id); | |
| user_data = user_response.get("users").get(0); | |
| timezone = user_data.get("time_zone"); | |
| appointment_time = contact_data.get("Modified_Time"); | |
| appointment_time_in_user_timezone = appointment_time.toDateTime("yyyy-MM-dd'T'HH:mm:ss").toString("MMM dd hh:mm a", timezone); | |
| return appointment_time_in_user_timezone; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const userId = $Crm.user.id; | |
| const userData = ZDK.Apps.CRM.Users.fetchById(userId); | |
| let phoneNumber = userData._phone; | |
| const twilioFromNumberRecords = ZDK.Apps.CRM.Twiliosmsextension0__Twilio_From_Numbers.searchByCriteria(`Owner:equals:${userId}`); | |
| if (twilioFromNumberRecords.length > 0) { | |
| phoneNumber = twilioFromNumberRecords[0]._Name; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sms_record = zoho.crm.getRecordById("twiliosmsextension0__Sent_SMS", sms_record_id); | |
| if (sms_record.get("Message_Type").startsWith("out")) { | |
| note_title = "Outbound SMS"; | |
| note_content = "Outbound SMS sent by " + sms_record.get("Owner").get("name") + ": " + sms_record.get("Message"); | |
| } else { | |
| note_title = "Inbound SMS"; | |
| note_content = "Inbound SMS received: " + sms_record.get("Message"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| config_map = configuration.toMap(); | |
| template_id = config_map.get("template_id"); | |
| to_email = config_map.get("to_email"); | |
| subject = config_map.get("subject"); | |
| from_name = config_map.get("from_name"); | |
| from_email = config_map.get("from_email"); | |
| module_name = config_map.get("module_name"); | |
| record_id = config_map.get("record_id"); | |
| org_email_address = config_map.get("org_email_address"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| inprogress_document_results = invokeurl | |
| [ | |
| url :"https://sign.zoho.com/api/v1/requests?request_status=inprogress" | |
| type :GET | |
| connection: "zohosignconnection" | |
| ]; | |
| requests = inprogress_document_results.get("requests"); | |
| unopened_documents = list(); | |
| for each request in requests | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try | |
| { | |
| if(error_message == null || error_message == "" || error_message.toString().length() < 5) | |
| { | |
| return; | |
| } | |
| // Put your DSN here | |
| dsn = "https://****@sentry.delugeonaluge.com/2"; | |
| processed_dsn = dsn.replaceAll("https://","").replaceAll("@",""); | |
| // Replace with the base URL (e.g. sentry.io/ ) |