Functions
#
Owner(userObject)
Lookup object fetch using API call. This will fetch the complete lookup record. If only lookup_id is required the variable Owner_Lookup_Id can be used, or for fetching the entire lookup object Owner() method can be used in which API call will be fired
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userObject |
Users |
<optional> |
User Object |
Examples
var lead = ZDK.Apps.CRM.Leads.fetchById("423383000005261048");
var leadOwner = lead.Owner();
var lead = ZDK.Apps.CRM.Leads.fetchById("423383000005261048");
lead.Owner(ZDK.Apps.CRM.Users.fetchById("423383000005261075"));
var response = lead.__update();
var lead = ZDK.Apps.CRM.Leads.fetchById("423383000005261048");
var leadOwnerLookupId = lead.Owner_Lookup_Id;
var lead = ZDK.Apps.CRM.Leads.fetchById("423383000005261048");
lead.Owner_Lookup_Id = "423383000005261075";
var response = lead.__update();
#
__create() → {array}
Create Record
CRMResponses object array
Example
var lead = new ZDK.Apps.CRM.Leads.Models.Leads();
lead.Last_Name = "James";
var response = lead.__create();
#
__update() → {CRMResponses}
Update Record
response
Example
var lead = ZDK.Apps.CRM.Leads.fetchById("4312588000000381015");
lead.Last_Name = "Updated Name";
var response = lead.__update();
#
__remove() → {CRMResponses}
Delete Record
response
Example
var lead = ZDK.Apps.CRM.Leads.fetchById("4312588000000381015");
var response = lead.__remove();
#
__convert(object) → {array}
Convert Record
Parameters:
Name | Type | Description |
---|---|---|
object |
ConvertLeads | convert leads object |
ConvertLeadsResponse object array
Example
var lead = ZDK.Apps.CRM.Leads.fetchById("4312588000000381015");
var convertLead = new ZDK.Apps.CRM.Leads.Models.ConvertLeads();
convertLead.Accounts = "735220000004375005";
var deal = new ZDK.Apps.CRM.Deals.Models.Deals();
deal.Deal_Name = "Convert";
deal.Closing_Date = "2020-11-20";
deal.Stage = ZDK.Apps.CRM.Deals.Models.StagePicklist.CLOSED_WON;
deal.Amount = 56.6
convertLead.Deals = deal;
var response = lead.__convert(convertLead)
#
__addTags(arrayOfTagNames) → {array}
Add Tags
Parameters:
Name | Type | Description |
---|---|---|
arrayOfTagNames |
Array.<String> | array of tag names |
CRMResponses object array
Example
var lead = ZDK.Apps.CRM.Leads.fetchById("4312588000000381015");
var response = lead.__addTags(["important", "approved"])
#
__removeTags(arrayOfTagNames) → {array}
Remove Tags
Parameters:
Name | Type | Description |
---|---|---|
arrayOfTagNames |
Array.<String> | array of tag names |
CRMResponses object array
Example
var lead = ZDK.Apps.CRM.Leads.fetchById("4312588000000381015");
var response = lead.__removeTags(["important", "approved"]);
#
__fetchRelatedRecords(related_list_api_name) → {array}
Fetch Related Records
Parameters:
Name | Type | Description |
---|---|---|
related_list_api_name |
String | related_list_api_name |
Related_Records object array
Example
var lead = ZDK.Apps.CRM.Leads.fetchById("4312588000000381015");
var related_records = lead.__fetchRelatedRecords("Notes");
for(var i=0; i< related_records.length; i++){
log(related_records[i]);
}
#
__delinkRelatedRecords(related_list_api_name, array_of_related_record_ids) → {array}
Delink Related Records
Parameters:
Name | Type | Description |
---|---|---|
related_list_api_name |
String | related_list_api_name |
array_of_related_record_ids |
Array.<String> | array of record ids |
CRMResponses object array
Example
var lead = ZDK.Apps.CRM.Leads.fetchById("4312588000000381015");
var ids = ["423383000300012916", "423383000002015945"];
var response = lead.__delinkRelatedRecords("Notes", ids);
#
__updateRelatedRecords(record, related_list_api_name, id) → {array}
Update Related Records
Parameters:
Name | Type | Description |
---|---|---|
record |
Related_Records | related record |
related_list_api_name |
String | related_list_api_name |
id |
String | related record id |
CRMResponses object array
Example
var lead = ZDK.Apps.CRM.Leads.fetchById("4312588000000381015");
var related_records = lead.__fetchRelatedRecords("Notes");
related_records[0].Note_Content = "updated content";
var response = lead.__updateRelatedRecords(related_records[0], "Notes", related_records[0].id);
#
__fetchBlueprint() → {Blueprint}
Fetch Blueprint
Blueprint object
Example
var lead = ZDK.Apps.CRM.Leads.fetchById("4312588000000381015");
var response = lead.__fetchBlueprint();
#
__approveRecord(action, comment) → {CRMResponses}
Approve Records
Parameters:
Name | Type | Description |
---|---|---|
action |
String | approve|delegate|reject |
comment |
String | comment |
object
Example
var lead = new ZDK.Apps.CRM.Leads.Models.Leads()
lead.id = "4312588000000381015";
var approval_response = lead.__approveRecord("approve", "approval comment");
log(approval_response.status);
#
__sendMail(mailObject) → {CRMResponses}
Send Mail
Parameters:
Name | Type | Description |
---|---|---|
mailObject |
Mail Object |
object
Example
var lead = ZDK.Apps.CRM.Leads.fetchById("4312588000000381015");
var mail = new ZDK.Apps.CRM.__Actions.Models.Mail();
mail.from = {"user_name": "james", "email": "james.cooper@zoho.com"};
mail.to = [ {"user_name": "john", "email": "john.carlton@zoho.com" }];
mail.subject = "Mail subject";
mail.content = "Content of the mail";
mail.mail_format = "text";
var response = lead.__sendMail(mail);
#
__getFeatureSpecificInfo(features) → {array}
Fetch Feature Specific Info
Parameters:
Name | Type | Description |
---|---|---|
features |
Array.<String> | blocked_emails, consecutive_negative_emails, unsubscribed_emails (at max only 5 features are allowed) |
FeatureInfo object array
Example
var lead = new ZDK.Apps.CRM.Leads.Models.Leads();
lead.id ="111117000000";
var response = lead.__getFeatureSpecificInfo(["blocked_emails,consecutive_negative_emails,unsubscribed_emails"]);
for(var i=0; i < response[0]._features_info.length; i++) {
log(response[0]._features_info[i]);
}