@pipedream/salesforce_rest_api 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/actions/salesforce-create-account/salesforce-create-account.mjs +374 -0
- package/actions/salesforce-create-attachment/salesforce-create-attachment.mjs +73 -0
- package/actions/salesforce-create-campaign/salesforce-create-campaign.mjs +148 -0
- package/actions/salesforce-create-case/salesforce-create-case.mjs +179 -0
- package/actions/salesforce-create-casecomment/salesforce-create-casecomment.mjs +58 -0
- package/actions/salesforce-create-contact/salesforce-create-contact.mjs +340 -0
- package/actions/salesforce-create-event/salesforce-create-event.mjs +232 -0
- package/actions/salesforce-create-lead/salesforce-create-lead.mjs +267 -0
- package/actions/salesforce-create-note/salesforce-create-note.mjs +63 -0
- package/actions/salesforce-create-opportunity/salesforce-create-opportunity.mjs +170 -0
- package/actions/salesforce-create-record/salesforce-create-record.mjs +36 -0
- package/actions/salesforce-create-task/salesforce-create-task.mjs +219 -0
- package/actions/salesforce-delete-opportunity/salesforce-delete-opportunity.mjs +37 -0
- package/actions/salesforce-get-sobject-fields-values/salesforce-get-sobject-fields-values.mjs +37 -0
- package/actions/salesforce-insert-blob-data/salesforce-insert-blob-data.mjs +70 -0
- package/actions/salesforce-make-api-call/salesforce-make-api-call.mjs +56 -0
- package/actions/salesforce-soql-search/salesforce-soql-search.mjs +29 -0
- package/actions/salesforce-sosl-search/salesforce-sosl-search.mjs +30 -0
- package/actions/salesforce-update-account/salesforce-update-account.mjs +357 -0
- package/actions/salesforce-update-contact/salesforce-update-contact.mjs +345 -0
- package/actions/salesforce-update-opportunity/salesforce-update-opportunity.mjs +171 -0
- package/actions/salesforce-update-record/salesforce-update-record.mjs +40 -0
- package/package.json +21 -0
- package/salesforce_rest_api.app.mjs +247 -0
- package/sources/common-instant.mjs +134 -0
- package/sources/common.mjs +96 -0
- package/sources/new-object/new-object.mjs +69 -0
- package/sources/new-object-instant/new-object-instant.mjs +35 -0
- package/sources/new-outbound-message/new-outbound-message.mjs +105 -0
- package/sources/object-deleted/object-deleted.mjs +52 -0
- package/sources/object-deleted-instant/object-deleted-instant.mjs +36 -0
- package/sources/object-updated/object-updated.mjs +63 -0
- package/sources/object-updated-instant/object-updated-instant.mjs +36 -0
- package/sources/updated-field-on-record/updated-field-on-record.mjs +179 -0
- package/sources/updated-field-on-record-instant/updated-field-on-record-instant.mjs +76 -0
- package/utils.mjs +27 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
// legacy_hash_id: a_l0i2O5
|
|
2
|
+
import { axios } from "@pipedream/platform";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "salesforce_rest_api-salesforce-create-event",
|
|
6
|
+
name: "Create Event",
|
|
7
|
+
description: "Creates an event, which represents an event in the calendar.",
|
|
8
|
+
version: "0.2.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
salesforce_rest_api: {
|
|
12
|
+
type: "app",
|
|
13
|
+
app: "salesforce_rest_api",
|
|
14
|
+
},
|
|
15
|
+
DurationInMinutes: {
|
|
16
|
+
type: "integer",
|
|
17
|
+
description: "Contains the event length, in minutes. Even though this field represents a temporal value, it is an integer typenot a Date/Time type.Required in versions 12.0 and earlier if IsAllDayEvent is false. In versions 13.0 and later, this field is optional, depending on the following: If IsAllDayEvent is true, you can supply a value for either DurationInMinutes or EndDateTime. Supplying values in both fields is allowed if the values add up to the same amount of time. If both fields are null, the duration defaults to one day. If IsAllDayEvent is false, a value must be supplied for either DurationInMinutes or EndDateTime. Supplying values in both fields is allowed if the values add up to the same amount of time. If the multiday event feature is enabled, then API versions 13.0 and later support values greater than 1440 for the DurationInMinutes field. API versions 12.0 and earlier can't access event objects whose DurationInMinutes is greater than 1440. For more information, see Multiday Events. Depending on your API version, errors with the DurationInMinutes and EndDateTime fields may appear in different places. Versions 38.0 and beforeErrors always appear in the DurationInMinutes field. Versions 39.0 and laterIf there's no value for the DurationInMinutes field, errors appear in the EndDateTime field. Otherwise, they appear in the DurationInMinutes field.",
|
|
18
|
+
},
|
|
19
|
+
AcceptedEventInviteeIds: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "A string array of contact or lead IDs who accepted this event. This JunctionIdList is linked to the AcceptedEventRelation child relationship. Warning Adding a JunctionIdList field name to the fieldsToNull property deletes all related junction records. This action can't be undone.",
|
|
22
|
+
optional: true,
|
|
23
|
+
},
|
|
24
|
+
ActivityDate: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "Contains the event's due date if the IsAllDayEvent flag is set to true. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. Don't attempt to alter the timestamp to account for time zone differences. Label is Due Date Only.This field is required in versions 12.0 and earlier if the IsAllDayEvent flag is set to true. The value for this field and StartDateTime must match, or one of them must be null.",
|
|
27
|
+
optional: true,
|
|
28
|
+
},
|
|
29
|
+
ActivityDateTime: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Contains the event's due date if the IsAllDayEvent flag is set to false. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate. Label is Due Date Time.This field is required in versions 12.0 and earlier if the IsAllDayEvent flag is set to false. The value for this field and StartDateTime must match, or one of them must be null.",
|
|
32
|
+
optional: true,
|
|
33
|
+
},
|
|
34
|
+
CurrencyIsoCode: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Available only for organizations with the multicurrency feature enabled. Contains the ISO code for any currency allowed by the organization.",
|
|
37
|
+
optional: true,
|
|
38
|
+
},
|
|
39
|
+
DeclinedEventInviteeIds: {
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "A string array of contact, lead, or user IDs who declined this event. This JunctionIdList is linked to the DeclinedEventRelation child relationship. Warning Adding a JunctionIdList field name to the fieldsToNull property deletes all related junction records. This action can't be undone.",
|
|
42
|
+
optional: true,
|
|
43
|
+
},
|
|
44
|
+
Description: {
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "Contains a text description of the event. Limit: 32,000 characters.",
|
|
47
|
+
optional: true,
|
|
48
|
+
},
|
|
49
|
+
EndDateTime: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Available in versions 13.0 and later. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate.This field is optional, depending on the following: If IsAllDayEvent is true, you can supply a value for either DurationInMinutes or EndDateTime. Supplying values in both fields is allowed if the values add up to the same amount of time. If both fields are null, the duration defaults to one day. If IsAllDayEvent is false, a value must be supplied for either DurationInMinutes or EndDateTime. Supplying values in both fields is allowed if the values add up to the same amount of time. Depending on your API version, errors with the DurationInMinutes and EndDateTime fields may appear in different places. Versions 38.0 and beforeErrors always appear in the DurationInMinutes field. Versions 39.0 and laterIf there's no value for the DurationInMinutes field, errors appear in the EndDateTime field. Otherwise, they appear in the DurationInMinutes field.",
|
|
52
|
+
optional: true,
|
|
53
|
+
},
|
|
54
|
+
EventSubtype: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "Provides standard subtypes to facilitate creating and searching for events. This field isn't updateable.",
|
|
57
|
+
optional: true,
|
|
58
|
+
},
|
|
59
|
+
EventWhoIds: {
|
|
60
|
+
type: "string",
|
|
61
|
+
description: "A string array of contact or lead IDs used to create many-to-many relationships with a shared event. EventWhoIds is available when the shared activities setting is enabled. The first contact or lead ID in the list becomes the primary WhoId if you don't specify a primary WhoId. If you set the EventWhoIds field to null, all entries in the list are deleted and the value of WhoId is added as the first entry. Warning Adding a JunctionIdList field name to the fieldsToNull property deletes all related junction records. This action can't be undone.",
|
|
62
|
+
optional: true,
|
|
63
|
+
},
|
|
64
|
+
IsAllDayEvent: {
|
|
65
|
+
type: "boolean",
|
|
66
|
+
description: "Indicates whether the ActivityDate field (true) or the ActivityDateTime field (false) is used to define the date or time of the event. Label is All-Day Event. See also DurationInMinutes and EndDateTime.",
|
|
67
|
+
optional: true,
|
|
68
|
+
},
|
|
69
|
+
IsPrivate: {
|
|
70
|
+
type: "boolean",
|
|
71
|
+
description: "Indicates whether users other than the creator of the event can (false) or can't (true) see the event details when viewing the event user's calendar. However, users with the View All Data or Modify All Data permission can see private events in reports and searches, or when viewing other users' calendars. Private events can't be associated with opportunities, accounts, cases, campaigns, contracts, leads, or contacts. Label is Private.",
|
|
72
|
+
optional: true,
|
|
73
|
+
},
|
|
74
|
+
IsRecurrence: {
|
|
75
|
+
type: "boolean",
|
|
76
|
+
description: "Indicates whether a Salesforce Classic event is scheduled to repeat itself (true) or only occurs once (false). This is a read-only field when updating records, but not when creating them. If this field value is true, then RecurrenceEndDateOnly, RecurrenceStartDateTime, RecurrenceType, and any recurrence fields associated with the given recurrence type must be populated. Label is Create recurring series of events.",
|
|
77
|
+
optional: true,
|
|
78
|
+
},
|
|
79
|
+
IsReminderSet: {
|
|
80
|
+
type: "boolean",
|
|
81
|
+
description: "Indicates whether the activity is a reminder (true) or not (false).",
|
|
82
|
+
optional: true,
|
|
83
|
+
},
|
|
84
|
+
Location: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description: "Contains the location of the event.",
|
|
87
|
+
optional: true,
|
|
88
|
+
},
|
|
89
|
+
OwnerId: {
|
|
90
|
+
type: "string",
|
|
91
|
+
description: "Contains the ID of the user or public calendar who owns the event. Label is Assigned to ID.",
|
|
92
|
+
optional: true,
|
|
93
|
+
},
|
|
94
|
+
RecurrenceDayOfMonth: {
|
|
95
|
+
type: "integer",
|
|
96
|
+
description: "Indicates the day of the month on which the event repeats.",
|
|
97
|
+
optional: true,
|
|
98
|
+
},
|
|
99
|
+
RecurrenceDayOfWeekMask: {
|
|
100
|
+
type: "integer",
|
|
101
|
+
description: "Indicates the day or days of the week on which the Salesforce Classic recurring event repeats. This field contains a bitmask. The values are as follows: Sunday = 1 Monday = 2 Tuesday = 4 Wednesday = 8 Thursday = 16 Friday = 32 Saturday = 64 Multiple days are represented as the sum of their numerical values. For example, Tuesday and Thursday = 4 + 16 = 20.",
|
|
102
|
+
optional: true,
|
|
103
|
+
},
|
|
104
|
+
RecurrenceEndDateOnly: {
|
|
105
|
+
type: "string",
|
|
106
|
+
description: "Indicates the last date on which the event repeats. For multiday Salesforce Classic recurring events, this is the day on which the last occurrence starts. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. Don't attempt to alter the timestamp to account for time zone differences.",
|
|
107
|
+
optional: true,
|
|
108
|
+
},
|
|
109
|
+
RecurrenceInstance: {
|
|
110
|
+
type: "string",
|
|
111
|
+
description: "Indicates the frequency of the Salesforce Classic event's recurrence. For example, 2nd or 3rd.",
|
|
112
|
+
optional: true,
|
|
113
|
+
},
|
|
114
|
+
RecurrenceInterval: {
|
|
115
|
+
type: "integer",
|
|
116
|
+
description: "Indicates the interval between Salesforce Classic recurring events.",
|
|
117
|
+
optional: true,
|
|
118
|
+
},
|
|
119
|
+
RecurrenceMonthOfYear: {
|
|
120
|
+
type: "string",
|
|
121
|
+
description: "Indicates the month in which the Salesforce Classic recurring event repeats.",
|
|
122
|
+
optional: true,
|
|
123
|
+
},
|
|
124
|
+
RecurrenceStartDateTime: {
|
|
125
|
+
type: "string",
|
|
126
|
+
description: "Indicates the date and time when the Salesforce Classic recurring event begins. The value must precede the RecurrenceEndDateOnly. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate.",
|
|
127
|
+
optional: true,
|
|
128
|
+
},
|
|
129
|
+
RecurrenceTimeZoneSidKey: {
|
|
130
|
+
type: "string",
|
|
131
|
+
description: "Indicates the time zone associated with a Salesforce Classic recurring event. For example, UTC-8:00 for Pacific Standard Time.",
|
|
132
|
+
optional: true,
|
|
133
|
+
},
|
|
134
|
+
RecurrenceType: {
|
|
135
|
+
type: "string",
|
|
136
|
+
description: "Indicates how often the Salesforce Classic event repeats. For example, daily, weekly, or every nth month (where nth is defined in RecurrenceInstance).",
|
|
137
|
+
optional: true,
|
|
138
|
+
},
|
|
139
|
+
ReminderDateTime: {
|
|
140
|
+
type: "string",
|
|
141
|
+
description: "Represents the time when the reminder is scheduled to fire, if IsReminderSet is set to true. If IsReminderSet is set to false, then the user may have deselected the reminder checkbox in the Salesforce user interface, or the reminder has already fired at the time indicated by the value.",
|
|
142
|
+
optional: true,
|
|
143
|
+
},
|
|
144
|
+
ShowAs: {
|
|
145
|
+
type: "string",
|
|
146
|
+
description: "Indicates how this event appears when another user views the calendar: Busy, Out of Office, or Free. Label is Show Time As.",
|
|
147
|
+
optional: true,
|
|
148
|
+
},
|
|
149
|
+
StartDateTime: {
|
|
150
|
+
type: "string",
|
|
151
|
+
description: "Indicates the start date and time of the event. Available in versions 13.0 and later.If the Event IsAllDayEvent flag is set to true (indicating that it is an all-day Event), then the event start date information is contained in the StartDateTime field. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate. If the Event IsAllDayEvent flag is set to false (indicating that it is not an all-day event), then the event start date information is contained in the StartDateTime field. The time portion is always transferred in the Coordinated Universal Time (UTC) time zone. You need to translate the time portion to or from a local time zone for the user or the application, as appropriate. If this field has a value, then ActivityDate and ActivityDateTime must either be null or match the value of this field.",
|
|
152
|
+
optional: true,
|
|
153
|
+
},
|
|
154
|
+
Subject: {
|
|
155
|
+
type: "string",
|
|
156
|
+
description: "The subject line of the event, such as Call, Email, or Meeting. Limit: 255 characters.",
|
|
157
|
+
optional: true,
|
|
158
|
+
},
|
|
159
|
+
Type: {
|
|
160
|
+
type: "string",
|
|
161
|
+
description: "Indicates the event type, such as Call, Email, or Meeting.",
|
|
162
|
+
optional: true,
|
|
163
|
+
},
|
|
164
|
+
UndecidedEventInviteeIds: {
|
|
165
|
+
type: "string",
|
|
166
|
+
description: "A string array of contact, lead, or user IDs who are undecided about this event. This JunctionIdList is linked to the UndecidedEventRelation child relationship. Warning Adding a JunctionIdList field name to the fieldsToNull property deletes all related junction records. This action can't be undone.",
|
|
167
|
+
optional: true,
|
|
168
|
+
},
|
|
169
|
+
WhatId: {
|
|
170
|
+
type: "string",
|
|
171
|
+
description: "The WhatId represents nonhuman objects such as accounts, opportunities, campaigns, cases, or custom objects. WhatIds are polymorphic. Polymorphic means a WhatId is equivalent to the ID of a related object. The label is Related To ID.",
|
|
172
|
+
optional: true,
|
|
173
|
+
},
|
|
174
|
+
WhoId: {
|
|
175
|
+
type: "string",
|
|
176
|
+
description: "The WhoId represents a human such as a lead or a contact. WhoIds are polymorphic. Polymorphic means a WhoId is equivalent to a contact's ID or a lead's ID. The label is Name ID.If Shared Activities is enabled, the value of this field is the ID of the related lead or primary contact. If you add, update, or remove the WhoId field, you might encounter problems with triggers, workflows, and data validation rules that are associated with the record. The label is Name ID. If the JunctionIdList field is used, all WhoIds are included in the relationship list. Beginning in API version 37.0, if the contact or lead ID in the WhoId field is not in the EventWhoIds list, no error occurs and the ID is added to the EventWhoIds as the primary WhoId. If WhoId is set to null, an arbitrary ID from the existing EventWhoIds list is promoted to the primary position.",
|
|
177
|
+
optional: true,
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
async run({ $ }) {
|
|
181
|
+
// See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm
|
|
182
|
+
// Event object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_event.htm
|
|
183
|
+
|
|
184
|
+
if (!this.DurationInMinutes) {
|
|
185
|
+
throw new Error("Must provide DurationInMinutes parameter.");
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return await axios($, {
|
|
189
|
+
"method": "post",
|
|
190
|
+
"url": `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/Event/`,
|
|
191
|
+
"Content-Type": "application/json",
|
|
192
|
+
"headers": {
|
|
193
|
+
Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
|
|
194
|
+
},
|
|
195
|
+
"data": {
|
|
196
|
+
AcceptedEventInviteeIds: this.AcceptedEventInviteeIds,
|
|
197
|
+
ActivityDate: this.ActivityDate,
|
|
198
|
+
ActivityDateTime: this.ActivityDateTime,
|
|
199
|
+
CurrencyIsoCode: this.CurrencyIsoCode,
|
|
200
|
+
DeclinedEventInviteeIds: this.DeclinedEventInviteeIds,
|
|
201
|
+
Description: this.Description,
|
|
202
|
+
DurationInMinutes: this.DurationInMinutes,
|
|
203
|
+
EndDateTime: this.EndDateTime,
|
|
204
|
+
EventSubtype: this.EventSubtype,
|
|
205
|
+
EventWhoIds: this.EventWhoIds,
|
|
206
|
+
IsAllDayEvent: this.IsAllDayEvent,
|
|
207
|
+
IsPrivate: this.IsPrivate,
|
|
208
|
+
IsRecurrence: this.IsRecurrence,
|
|
209
|
+
IsReminderSet: this.IsReminderSet,
|
|
210
|
+
Location: this.Location,
|
|
211
|
+
OwnerId: this.OwnerId,
|
|
212
|
+
RecurrenceDayOfMonth: this.RecurrenceDayOfMonth,
|
|
213
|
+
RecurrenceDayOfWeekMask: this.RecurrenceDayOfWeekMask,
|
|
214
|
+
RecurrenceEndDateOnly: this.RecurrenceEndDateOnly,
|
|
215
|
+
RecurrenceInstance: this.RecurrenceInstance,
|
|
216
|
+
RecurrenceInterval: this.RecurrenceInterval,
|
|
217
|
+
RecurrenceMonthOfYear: this.RecurrenceMonthOfYear,
|
|
218
|
+
RecurrenceStartDateTime: this.RecurrenceStartDateTime,
|
|
219
|
+
RecurrenceTimeZoneSidKey: this.RecurrenceTimeZoneSidKey,
|
|
220
|
+
RecurrenceType: this.RecurrenceType,
|
|
221
|
+
ReminderDateTime: this.ReminderDateTime,
|
|
222
|
+
ShowAs: this.ShowAs,
|
|
223
|
+
StartDateTime: this.StartDateTime,
|
|
224
|
+
Subject: this.Subject,
|
|
225
|
+
Type: this.Type,
|
|
226
|
+
UndecidedEventInviteeIds: this.UndecidedEventInviteeIds,
|
|
227
|
+
WhatId: this.WhatId,
|
|
228
|
+
WhoId: this.WhoId,
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
},
|
|
232
|
+
};
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
// legacy_hash_id: a_jQiWR4
|
|
2
|
+
import { axios } from "@pipedream/platform";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "salesforce_rest_api-salesforce-create-lead",
|
|
6
|
+
name: "Create Lead",
|
|
7
|
+
description: "Creates a lead, which represents a prospect or lead.",
|
|
8
|
+
version: "0.2.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
salesforce_rest_api: {
|
|
12
|
+
type: "app",
|
|
13
|
+
app: "salesforce_rest_api",
|
|
14
|
+
},
|
|
15
|
+
Company: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Required. The lead's company. Note If person account record types have been enabled, and if the value of Company is null, the lead converts to a person account.",
|
|
18
|
+
},
|
|
19
|
+
LastName: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Required. Last name of the lead up to 80 characters.",
|
|
22
|
+
},
|
|
23
|
+
AnnualRevenue: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Annual revenue for the lead's company.",
|
|
26
|
+
optional: true,
|
|
27
|
+
},
|
|
28
|
+
City: {
|
|
29
|
+
type: "string",
|
|
30
|
+
description: "City for the lead's address.",
|
|
31
|
+
optional: true,
|
|
32
|
+
},
|
|
33
|
+
CleanStatus: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "Indicates the record's clean status compared with Data.com. Values include: Matched, Different, Acknowledged, NotFound, Inactive, Pending, SelectMatch, or Skipped.Several values for CleanStatus appear with different labels on the lead record. Matched appears as In Sync Acknowledged appears as Reviewed Pending appears as Not Compared",
|
|
36
|
+
optional: true,
|
|
37
|
+
},
|
|
38
|
+
CompanyDunsNumber: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "The Data Universal Numbering System (D-U-N-S) number, which is a unique, nine-digit number assigned to every business location in the Dun & Bradstreet database that has a unique, separate, and distinct operation. Industries and companies use D-U-N-S numbers as a global standard for business identification and tracking. Maximum size is 9 characters. Note This field is only available to organizations that use Data.com Prospector or Data.com Clean.",
|
|
41
|
+
optional: true,
|
|
42
|
+
},
|
|
43
|
+
Country: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "The lead's country.",
|
|
46
|
+
optional: true,
|
|
47
|
+
},
|
|
48
|
+
CountryCode: {
|
|
49
|
+
type: "string",
|
|
50
|
+
description: "The ISO country code for the lead's address.",
|
|
51
|
+
optional: true,
|
|
52
|
+
},
|
|
53
|
+
CurrencyIsoCode: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Available only for organizations with the multicurrency feature enabled. Contains the ISO code for any currency allowed by the organization.",
|
|
56
|
+
optional: true,
|
|
57
|
+
},
|
|
58
|
+
Description: {
|
|
59
|
+
type: "string",
|
|
60
|
+
description: "The lead's description.",
|
|
61
|
+
optional: true,
|
|
62
|
+
},
|
|
63
|
+
Email: {
|
|
64
|
+
type: "string",
|
|
65
|
+
description: "The lead's email address.",
|
|
66
|
+
optional: true,
|
|
67
|
+
},
|
|
68
|
+
Fax: {
|
|
69
|
+
type: "string",
|
|
70
|
+
description: "The lead's fax number.",
|
|
71
|
+
optional: true,
|
|
72
|
+
},
|
|
73
|
+
FirstName: {
|
|
74
|
+
type: "string",
|
|
75
|
+
description: "The lead's first name up to 40 characters.",
|
|
76
|
+
optional: true,
|
|
77
|
+
},
|
|
78
|
+
HasOptedOutOfEmail: {
|
|
79
|
+
type: "boolean",
|
|
80
|
+
description: "Indicates whether the lead doesn't want to receive email from Salesforce (true) or does (false). Label is Email Opt Out.",
|
|
81
|
+
optional: true,
|
|
82
|
+
},
|
|
83
|
+
GeocodeAccuracy: {
|
|
84
|
+
type: "string",
|
|
85
|
+
description: "Accuracy level of the geocode for the address. For details on geolocation compound fields, see [Compound Field Considerations and Limitations](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields_limitations.htm#compound_fields_limitations).",
|
|
86
|
+
optional: true,
|
|
87
|
+
},
|
|
88
|
+
IndividualId: {
|
|
89
|
+
type: "string",
|
|
90
|
+
description: "ID of the data privacy record associated with this lead. This field is available if you enabled Data Protection and Privacy in Setup.",
|
|
91
|
+
optional: true,
|
|
92
|
+
},
|
|
93
|
+
Industry: {
|
|
94
|
+
type: "string",
|
|
95
|
+
description: "Industry in which the lead works.",
|
|
96
|
+
optional: true,
|
|
97
|
+
},
|
|
98
|
+
IsConverted: {
|
|
99
|
+
type: "boolean",
|
|
100
|
+
description: "Indicates whether the lead has been converted (true) or not (false). Label is Converted.",
|
|
101
|
+
optional: true,
|
|
102
|
+
},
|
|
103
|
+
IsUnreadByOwner: {
|
|
104
|
+
type: "boolean",
|
|
105
|
+
description: "If true, lead has been assigned, but not yet viewed. See Unread Leads for more information. Label is Unread By Owner.",
|
|
106
|
+
optional: true,
|
|
107
|
+
},
|
|
108
|
+
Jigsaw: {
|
|
109
|
+
type: "string",
|
|
110
|
+
description: "References the ID of a contact in Data.com. If a lead has a value in this field, it means that a contact was imported as a lead from Data.com. If the contact (converted to a lead) was not imported from Data.com, the field value is null. Maximum size is 20 characters.",
|
|
111
|
+
optional: true,
|
|
112
|
+
},
|
|
113
|
+
Latitude: {
|
|
114
|
+
type: "integer",
|
|
115
|
+
description: "Used with Longitude to specify the precise geolocation of an address. Acceptable values are numbers between 90 and 90 up to 15 decimal places. For details on geolocation compound fields, see [Compound Field Considerations and Limitations](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields_limitations.htm#compound_fields_limitations).",
|
|
116
|
+
optional: true,
|
|
117
|
+
},
|
|
118
|
+
Longitude: {
|
|
119
|
+
type: "integer",
|
|
120
|
+
description: "Used with Latitude to specify the precise geolocation of an address. Acceptable values are numbers between 180 and 180 up to 15 decimal places. For details on geolocation compound fields, see [Compound Field Considerations and Limitations](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields_limitations.htm#compound_fields_limitations).",
|
|
121
|
+
optional: true,
|
|
122
|
+
},
|
|
123
|
+
LeadSource: {
|
|
124
|
+
type: "string",
|
|
125
|
+
description: "The lead's source.",
|
|
126
|
+
optional: true,
|
|
127
|
+
},
|
|
128
|
+
MiddleName: {
|
|
129
|
+
type: "string",
|
|
130
|
+
description: "The lead's middle name up to 40 characters. To enable this field, ask Salesforce Customer Support for help.",
|
|
131
|
+
optional: true,
|
|
132
|
+
},
|
|
133
|
+
MobilePhone: {
|
|
134
|
+
type: "string",
|
|
135
|
+
description: "The lead's mobile phone number.",
|
|
136
|
+
optional: true,
|
|
137
|
+
},
|
|
138
|
+
NumberOfEmployees: {
|
|
139
|
+
type: "integer",
|
|
140
|
+
description: "Number of employees at the lead's company. Label is Employees.",
|
|
141
|
+
optional: true,
|
|
142
|
+
},
|
|
143
|
+
OwnerId: {
|
|
144
|
+
type: "string",
|
|
145
|
+
description: "ID of the lead's owner.",
|
|
146
|
+
optional: true,
|
|
147
|
+
},
|
|
148
|
+
Phone: {
|
|
149
|
+
type: "string",
|
|
150
|
+
description: "The lead's phone number.",
|
|
151
|
+
optional: true,
|
|
152
|
+
},
|
|
153
|
+
PostalCode: {
|
|
154
|
+
type: "string",
|
|
155
|
+
description: "Postal code for the address of the lead.",
|
|
156
|
+
optional: true,
|
|
157
|
+
},
|
|
158
|
+
Rating: {
|
|
159
|
+
type: "string",
|
|
160
|
+
description: "Rating of the lead.",
|
|
161
|
+
optional: true,
|
|
162
|
+
},
|
|
163
|
+
RecordTypeId: {
|
|
164
|
+
type: "string",
|
|
165
|
+
description: "ID of the record type assigned to this object.",
|
|
166
|
+
optional: true,
|
|
167
|
+
},
|
|
168
|
+
Salutation: {
|
|
169
|
+
type: "string",
|
|
170
|
+
description: "Salutation for the lead.",
|
|
171
|
+
optional: true,
|
|
172
|
+
},
|
|
173
|
+
State: {
|
|
174
|
+
type: "string",
|
|
175
|
+
description: "State for the address of the lead.",
|
|
176
|
+
optional: true,
|
|
177
|
+
},
|
|
178
|
+
StateCode: {
|
|
179
|
+
type: "string",
|
|
180
|
+
description: "The ISO state code for the lead's address.",
|
|
181
|
+
optional: true,
|
|
182
|
+
},
|
|
183
|
+
Status: {
|
|
184
|
+
type: "string",
|
|
185
|
+
description: "Status code for this converted lead. Status codes are defined in Status and represented in the API by the LeadStatus object.",
|
|
186
|
+
optional: true,
|
|
187
|
+
},
|
|
188
|
+
Street: {
|
|
189
|
+
type: "string",
|
|
190
|
+
description: "Street number and name for the address of the lead.",
|
|
191
|
+
optional: true,
|
|
192
|
+
},
|
|
193
|
+
Suffix: {
|
|
194
|
+
type: "string",
|
|
195
|
+
description: "The lead's name suffix up to 40 characters. To enable this field, ask Salesforce Customer Support for help.",
|
|
196
|
+
optional: true,
|
|
197
|
+
},
|
|
198
|
+
Title: {
|
|
199
|
+
type: "string",
|
|
200
|
+
description: "Title for the lead, such as CFO or CEO.",
|
|
201
|
+
optional: true,
|
|
202
|
+
},
|
|
203
|
+
Website: {
|
|
204
|
+
type: "string",
|
|
205
|
+
description: "Website for the lead.",
|
|
206
|
+
optional: true,
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
async run({ $ }) {
|
|
210
|
+
// See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm
|
|
211
|
+
// Lead object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_lead.htm
|
|
212
|
+
|
|
213
|
+
if (!this.Company || !this.LastName) {
|
|
214
|
+
throw new Error("Must provide Company and LastName parameters.");
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return await axios($, {
|
|
218
|
+
"method": "post",
|
|
219
|
+
"url": `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/Lead/`,
|
|
220
|
+
"Content-Type": "application/json",
|
|
221
|
+
"headers": {
|
|
222
|
+
Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
|
|
223
|
+
},
|
|
224
|
+
"data": {
|
|
225
|
+
AnnualRevenue: this.AnnualRevenue,
|
|
226
|
+
City: this.City,
|
|
227
|
+
CleanStatus: this.CleanStatus,
|
|
228
|
+
Company: this.Company,
|
|
229
|
+
CompanyDunsNumber: this.CompanyDunsNumber,
|
|
230
|
+
Country: this.Country,
|
|
231
|
+
CountryCode: this.CountryCode,
|
|
232
|
+
CurrencyIsoCode: this.CurrencyIsoCode,
|
|
233
|
+
Description: this.Description,
|
|
234
|
+
Email: this.Email,
|
|
235
|
+
Fax: this.Fax,
|
|
236
|
+
FirstName: this.FirstName,
|
|
237
|
+
HasOptedOutOfEmail: this.HasOptedOutOfEmail,
|
|
238
|
+
GeocodeAccuracy: this.GeocodeAccuracy,
|
|
239
|
+
IndividualId: this.IndividualId,
|
|
240
|
+
Industry: this.Industry,
|
|
241
|
+
IsConverted: this.IsConverted,
|
|
242
|
+
IsUnreadByOwner: this.IsUnreadByOwner,
|
|
243
|
+
Jigsaw: this.Jigsaw,
|
|
244
|
+
LastName: this.LastName,
|
|
245
|
+
Latitude: this.Latitude,
|
|
246
|
+
Longitude: this.Longitude,
|
|
247
|
+
LeadSource: this.LeadSource,
|
|
248
|
+
MiddleName: this.MiddleName,
|
|
249
|
+
MobilePhone: this.MobilePhone,
|
|
250
|
+
NumberOfEmployees: this.NumberOfEmployees,
|
|
251
|
+
OwnerId: this.OwnerId,
|
|
252
|
+
Phone: this.Phone,
|
|
253
|
+
PostalCode: this.PostalCode,
|
|
254
|
+
Rating: this.Rating,
|
|
255
|
+
RecordTypeId: this.RecordTypeId,
|
|
256
|
+
Salutation: this.Salutation,
|
|
257
|
+
State: this.State,
|
|
258
|
+
StateCode: this.StateCode,
|
|
259
|
+
Status: this.Status,
|
|
260
|
+
Street: this.Street,
|
|
261
|
+
Suffix: this.Suffix,
|
|
262
|
+
Title: this.Title,
|
|
263
|
+
Website: this.Website,
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
},
|
|
267
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// legacy_hash_id: a_Vpi7PO
|
|
2
|
+
import { axios } from "@pipedream/platform";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "salesforce_rest_api-salesforce-create-note",
|
|
6
|
+
name: "Create Note",
|
|
7
|
+
description: "Creates a note, which is text associated with a custom object or a standard object, such as a Contact, Contract, or Opportunity.",
|
|
8
|
+
version: "0.2.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
salesforce_rest_api: {
|
|
12
|
+
type: "app",
|
|
13
|
+
app: "salesforce_rest_api",
|
|
14
|
+
},
|
|
15
|
+
ParentId: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "ID of the object associated with the note.",
|
|
18
|
+
},
|
|
19
|
+
Title: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Title of the note.",
|
|
22
|
+
},
|
|
23
|
+
Body: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Body of the note. Limited to 32 KB.",
|
|
26
|
+
optional: true,
|
|
27
|
+
},
|
|
28
|
+
IsPrivate: {
|
|
29
|
+
type: "boolean",
|
|
30
|
+
description: "If true, only the note owner or a user with the Modify All Data permission can view the note or query it via the API. Note that if a user who does not have the Modify All Data permission sets this field to true on a note that they do not own, then they can no longer query, delete, or update the note.",
|
|
31
|
+
optional: true,
|
|
32
|
+
},
|
|
33
|
+
OwnerId: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "ID of the user who owns the note.",
|
|
36
|
+
optional: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
async run({ $ }) {
|
|
40
|
+
// See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm
|
|
41
|
+
// Note object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_note.htm
|
|
42
|
+
|
|
43
|
+
if (!this.ParentId || !this.Title) {
|
|
44
|
+
throw new Error("Must provide ParentId and Title parameters.");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return await axios($, {
|
|
48
|
+
"method": "post",
|
|
49
|
+
"url": `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/Note/`,
|
|
50
|
+
"Content-Type": "application/json",
|
|
51
|
+
"headers": {
|
|
52
|
+
Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
|
|
53
|
+
},
|
|
54
|
+
"data": {
|
|
55
|
+
Body: this.Body,
|
|
56
|
+
IsPrivate: this.IsPrivate,
|
|
57
|
+
OwnerId: this.OwnerId,
|
|
58
|
+
ParentId: this.ParentId,
|
|
59
|
+
Title: this.Title,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
};
|