salesforce-platform-nxg-cg-lib
v1.0.6
Published
Integration with saleforce API's
Downloads
11
Readme
Salesforce getQueryObject
This code has the objective of getting all the information inside of a Salesforce object in a Json format.
Example:
Retrieving all Lead Object information.
::Input example::
url : "https://yoursalesforce.salesforce.com",
query : "SELECT FIELDS(All) FROM LEAD ORDER BY Name LIMIT 50",
clientId : "yourClientID",
clientSecret : "yourClientSecret"
::Output example::
info: Jan-18-2024 15:08:58: {
totalSize: 1,
done: true,
records: [
{
attributes: [Object],
Id: '00QHs00001y2vZqMAI',
IsDeleted: false,
MasterRecordId: null,
LastName: 'Young',
FirstName: 'Andy',
Salutation: 'Mr',
Name: 'Andy Young',
Title: 'SVP, Operations',
Company: 'Dickenson plc',
Street: null,
City: null,
State: 'KS',
PostalCode: null,
Country: 'USA',
Latitude: null,
Longitude: null,
GeocodeAccuracy: null,
Address: [Object],
Phone: '(620) 241-6200',
MobilePhone: null,
Fax: null,
Email: '[email protected]',
Website: null,
PhotoUrl: '/services/images/photo/00QHs00001y2vZqMAI',
Description: null,
LeadSource: 'Purchased List',
Status: 'Closed - Converted',
Industry: null,
Rating: null,
AnnualRevenue: null,
NumberOfEmployees: null,
OwnerId: '005Hs00000DwqsAIAR',
IsConverted: false,
ConvertedDate: null,
ConvertedAccountId: null,
ConvertedContactId: null,
ConvertedOpportunityId: null,
IsUnreadByOwner: true,
CreatedDate: '2024-01-10T17:44:10.000+0000',
CreatedById: '005Hs00000DwqsAIAR',
LastModifiedDate: '2024-01-10T17:44:10.000+0000',
LastModifiedById: '005Hs00000DwqsAIAR',
SystemModstamp: '2024-01-10T18:09:11.000+0000',
LastActivityDate: null,
LastViewedDate: null,
LastReferencedDate: null,
Jigsaw: null,
JigsawContactId: null,
CleanStatus: 'Pending',
CompanyDunsNumber: null,
DandbCompanyId: null,
EmailBouncedReason: null,
EmailBouncedDate: null,
IndividualId: null,
IsPriorityRecord: false,
SICCode__c: '2768',
ProductInterest__c: 'GC5000 series',
Primary__c: 'Yes',
CurrentGenerators__c: 'All',
NumberofLocations__c: 130
}
]
}
Salesforce objectCreate
This code has the objective of adding a new item on a saleforce object.
Example:
Adding a new item to Lead object.
::Input example::
let cfg = {
url : "https://yoursalesforce.my.salesforce.com",
version: "yourVersion",
sobject_api_name: "lead",
clientId : "yourClientID",
clientSecret : "yourClientSecret",
tableProperties : {
"LastName": "Ortiz",
"FirstName": "Mauricio",
"Company" : "CloudGenSys"
}
}
::Output example::
info: Jan-23-2024 16:18:42: { id: '00QHs00001xdjg4MAA', success: true, errors: [] }
Salesforce objectDelete
This code has the objective of removing an item from a saleforce object.
Example:
Deleting an item from Lead object.
::Input example::
let cfg = {
url : "https://yoursalesforce.my.salesforce.com",
version: "yourVersion",
sobject_api_name: "lead",
clientId : "yourClientID",
clientSecret : "yourClientSecret",
recordId : "yourRecordID"
}
::Output example::
There will be no response
Salesforce objectUpdate
This code has the objective of updating an item from a saleforce object.
Example:
Updating an item from Lead object.
::Input example::
let cfg = {
url : "https://yoursalesforce.my.salesforce.com",
version: "yourVersion",
sobject_api_name: "lead",
clientId : "yourClientID",
clientSecret : "yourClientSecret",
recordId : "yourRecordID",
tableProperties : {
"Title": "Solutions Architect",
"LeadSource": "Phone Inquiry"
}
::Output example::
There will be no response