@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,345 @@
|
|
|
1
|
+
// legacy_hash_id: a_2wino7
|
|
2
|
+
import { axios } from "@pipedream/platform";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "salesforce_rest_api-salesforce-update-contact",
|
|
6
|
+
name: "Update Contact",
|
|
7
|
+
description: "Updates a Contact, which is a person associated with an account.",
|
|
8
|
+
version: "0.2.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
salesforce_rest_api: {
|
|
12
|
+
type: "app",
|
|
13
|
+
app: "salesforce_rest_api",
|
|
14
|
+
},
|
|
15
|
+
ContactId: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Id of the Contact to update.",
|
|
18
|
+
},
|
|
19
|
+
AccountId: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "ID of the account that's the parent of this contact. We recommend that you update up to 50 contacts simultaneously when changing the accounts on contacts enabled for a Customer Portal or partner portal. We also recommend that you make this update after business hours.",
|
|
22
|
+
optional: true,
|
|
23
|
+
},
|
|
24
|
+
AssistantName: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "The assistant's name.",
|
|
27
|
+
optional: true,
|
|
28
|
+
},
|
|
29
|
+
AssistantPhone: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "The assistant's telephone number.",
|
|
32
|
+
optional: true,
|
|
33
|
+
},
|
|
34
|
+
Birthdate: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "The contact's birthdate.Filter criteria for report filters, list view filters, and SOQL queries ignore the year portion of the Birthdate field. For example, this SOQL query returns contacts with birthdays later in the year than today:view sourceprint?1SELECT Name, Birthdate2FROM Contact3WHERE Birthdate > TODAY",
|
|
37
|
+
optional: true,
|
|
38
|
+
},
|
|
39
|
+
CanAllowPortalSelfReg: {
|
|
40
|
+
type: "boolean",
|
|
41
|
+
description: "Indicates whether this contact can self-register for your Customer Portal (true) or not (false).",
|
|
42
|
+
optional: true,
|
|
43
|
+
},
|
|
44
|
+
CleanStatus: {
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "Indicates the record's clean status as 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 contact record. Matched appears as In Sync Acknowledged appears as Reviewed Pending appears as Not Compared",
|
|
47
|
+
optional: true,
|
|
48
|
+
},
|
|
49
|
+
Department: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "The contact's department.",
|
|
52
|
+
optional: true,
|
|
53
|
+
},
|
|
54
|
+
Description: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "A description of the contact. Label is Contact Description up to 32 KB.",
|
|
57
|
+
optional: true,
|
|
58
|
+
},
|
|
59
|
+
DoNotCall: {
|
|
60
|
+
type: "boolean",
|
|
61
|
+
description: "Indicates that the contact does not want to receive calls.",
|
|
62
|
+
optional: true,
|
|
63
|
+
},
|
|
64
|
+
Email: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "The contact's email address.",
|
|
67
|
+
optional: true,
|
|
68
|
+
},
|
|
69
|
+
EmailBouncedDate: {
|
|
70
|
+
type: "string",
|
|
71
|
+
description: "If bounce management is activated and an email sent to the contact bounces, the date and time of the bounce.",
|
|
72
|
+
optional: true,
|
|
73
|
+
},
|
|
74
|
+
EmailBouncedReason: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "If bounce management is activated and an email sent to the contact bounces, the reason for the bounce.",
|
|
77
|
+
optional: true,
|
|
78
|
+
},
|
|
79
|
+
Fax: {
|
|
80
|
+
type: "string",
|
|
81
|
+
description: "The contact's fax number. Label is Business Fax.",
|
|
82
|
+
optional: true,
|
|
83
|
+
},
|
|
84
|
+
FirstName: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description: "The contact's first name up to 40 characters.",
|
|
87
|
+
optional: true,
|
|
88
|
+
},
|
|
89
|
+
HasOptedOutOfEmail: {
|
|
90
|
+
type: "boolean",
|
|
91
|
+
description: "Indicates whether the contact doesn't want to receive email from Salesforce (true) or does (false). Label is Email Opt Out.",
|
|
92
|
+
optional: true,
|
|
93
|
+
},
|
|
94
|
+
HasOptedOutOfFax: {
|
|
95
|
+
type: "boolean",
|
|
96
|
+
description: "Indicates whether the contact prohibits receiving faxes.",
|
|
97
|
+
optional: true,
|
|
98
|
+
},
|
|
99
|
+
HomePhone: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "The contact's home telephone number.",
|
|
102
|
+
optional: true,
|
|
103
|
+
},
|
|
104
|
+
IndividualId: {
|
|
105
|
+
type: "string",
|
|
106
|
+
description: "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled.",
|
|
107
|
+
optional: true,
|
|
108
|
+
},
|
|
109
|
+
Jigsaw: {
|
|
110
|
+
type: "string",
|
|
111
|
+
description: "References the company's ID in Data.com. If an account has a value in this field, it means that the account was imported from Data.com. If the field value is null, the account was not imported from Data.com. Maximum size is 20 characters. Available in API version 22.0 and later. Label is Data.com Key. Important The Jigsaw field is exposed in the API to support troubleshooting for import errors and reimporting of corrected data. Do not modify this value.",
|
|
112
|
+
optional: true,
|
|
113
|
+
},
|
|
114
|
+
LastName: {
|
|
115
|
+
type: "string",
|
|
116
|
+
description: "Required. Last name of the contact up to 80 characters.",
|
|
117
|
+
optional: true,
|
|
118
|
+
},
|
|
119
|
+
LeadSource: {
|
|
120
|
+
type: "string",
|
|
121
|
+
description: "The lead's source.",
|
|
122
|
+
optional: true,
|
|
123
|
+
},
|
|
124
|
+
MailingCity: {
|
|
125
|
+
type: "string",
|
|
126
|
+
description: "Mailing address details.",
|
|
127
|
+
optional: true,
|
|
128
|
+
},
|
|
129
|
+
MailingState: {
|
|
130
|
+
type: "string",
|
|
131
|
+
description: "Mailing address details.",
|
|
132
|
+
optional: true,
|
|
133
|
+
},
|
|
134
|
+
MailingCountry: {
|
|
135
|
+
type: "string",
|
|
136
|
+
description: "Mailing address details.",
|
|
137
|
+
optional: true,
|
|
138
|
+
},
|
|
139
|
+
MailingPostalCode: {
|
|
140
|
+
type: "string",
|
|
141
|
+
description: "Mailing address details.",
|
|
142
|
+
optional: true,
|
|
143
|
+
},
|
|
144
|
+
MailingStateCode: {
|
|
145
|
+
type: "string",
|
|
146
|
+
description: "The ISO codes for the mailing address's state.",
|
|
147
|
+
optional: true,
|
|
148
|
+
},
|
|
149
|
+
MailingCountryCode: {
|
|
150
|
+
type: "string",
|
|
151
|
+
description: "The ISO codes for the mailing address's country.",
|
|
152
|
+
optional: true,
|
|
153
|
+
},
|
|
154
|
+
MailingStreet: {
|
|
155
|
+
type: "string",
|
|
156
|
+
description: "Street address for mailing address.",
|
|
157
|
+
optional: true,
|
|
158
|
+
},
|
|
159
|
+
MailingGeocodeAccuracy: {
|
|
160
|
+
type: "string",
|
|
161
|
+
description: "Accuracy level of the geocode for the mailing address. For details on geolocation compound field, see [Compound Field Considerations and Limitations](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields_limitations.htm#compound_fields_limitations).",
|
|
162
|
+
optional: true,
|
|
163
|
+
},
|
|
164
|
+
MailingLatitude: {
|
|
165
|
+
type: "integer",
|
|
166
|
+
description: "Used with MailingLongitude to specify the precise geolocation of a mailing 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).",
|
|
167
|
+
optional: true,
|
|
168
|
+
},
|
|
169
|
+
MailingLongitude: {
|
|
170
|
+
type: "integer",
|
|
171
|
+
description: "Used with MailingLatitude to specify the precise geolocation of a mailing 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).",
|
|
172
|
+
optional: true,
|
|
173
|
+
},
|
|
174
|
+
MiddleName: {
|
|
175
|
+
type: "string",
|
|
176
|
+
description: "The contact's middle name up to 40 characters. To enable this field, ask Salesforce Customer Support for help.",
|
|
177
|
+
optional: true,
|
|
178
|
+
},
|
|
179
|
+
MobilePhone: {
|
|
180
|
+
type: "string",
|
|
181
|
+
description: "Contact's mobile phone number.",
|
|
182
|
+
optional: true,
|
|
183
|
+
},
|
|
184
|
+
OtherCity: {
|
|
185
|
+
type: "string",
|
|
186
|
+
description: "Alternate address details.",
|
|
187
|
+
optional: true,
|
|
188
|
+
},
|
|
189
|
+
OtherCountry: {
|
|
190
|
+
type: "string",
|
|
191
|
+
description: "Alternate address details.",
|
|
192
|
+
optional: true,
|
|
193
|
+
},
|
|
194
|
+
OtherPostalCode: {
|
|
195
|
+
type: "string",
|
|
196
|
+
description: "Alternate address details.",
|
|
197
|
+
optional: true,
|
|
198
|
+
},
|
|
199
|
+
OtherState: {
|
|
200
|
+
type: "string",
|
|
201
|
+
description: "Alternate address details.",
|
|
202
|
+
optional: true,
|
|
203
|
+
},
|
|
204
|
+
OtherCountryCode: {
|
|
205
|
+
type: "string",
|
|
206
|
+
description: "The ISO codes for the alternate address's country.",
|
|
207
|
+
optional: true,
|
|
208
|
+
},
|
|
209
|
+
OtherStateCode: {
|
|
210
|
+
type: "string",
|
|
211
|
+
description: "The ISO codes for the alternate address's state.",
|
|
212
|
+
optional: true,
|
|
213
|
+
},
|
|
214
|
+
OtherGeocodeAccuracy: {
|
|
215
|
+
type: "string",
|
|
216
|
+
description: "Accuracy level of the geocode for the other 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).",
|
|
217
|
+
optional: true,
|
|
218
|
+
},
|
|
219
|
+
OtherLatitude: {
|
|
220
|
+
type: "integer",
|
|
221
|
+
description: "Used with OtherLongitude to specify the precise geolocation of an alternate 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).",
|
|
222
|
+
optional: true,
|
|
223
|
+
},
|
|
224
|
+
OtherLongitude: {
|
|
225
|
+
type: "integer",
|
|
226
|
+
description: "Used with OtherLatitude to specify the precise geolocation of an alternate 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).",
|
|
227
|
+
optional: true,
|
|
228
|
+
},
|
|
229
|
+
OtherPhone: {
|
|
230
|
+
type: "string",
|
|
231
|
+
description: "Telephone for alternate address.",
|
|
232
|
+
optional: true,
|
|
233
|
+
},
|
|
234
|
+
OtherStreet: {
|
|
235
|
+
type: "string",
|
|
236
|
+
description: "Street for alternate address.",
|
|
237
|
+
optional: true,
|
|
238
|
+
},
|
|
239
|
+
OwnerId: {
|
|
240
|
+
type: "string",
|
|
241
|
+
description: "The ID of the owner of the account associated with this contact.",
|
|
242
|
+
optional: true,
|
|
243
|
+
},
|
|
244
|
+
Phone: {
|
|
245
|
+
type: "string",
|
|
246
|
+
description: "Telephone number for the contact. Label is Business Phone.",
|
|
247
|
+
optional: true,
|
|
248
|
+
},
|
|
249
|
+
RecordTypeId: {
|
|
250
|
+
type: "string",
|
|
251
|
+
description: "ID of the record type assigned to this object.",
|
|
252
|
+
optional: true,
|
|
253
|
+
},
|
|
254
|
+
ReportsToId: {
|
|
255
|
+
type: "string",
|
|
256
|
+
description: "This field doesn't appear if IsPersonAccount is true.",
|
|
257
|
+
optional: true,
|
|
258
|
+
},
|
|
259
|
+
Salutation: {
|
|
260
|
+
type: "string",
|
|
261
|
+
description: "Honorific abbreviation, word, or phrase to be used in front of name in greetings, such as Dr. or Mrs.",
|
|
262
|
+
optional: true,
|
|
263
|
+
},
|
|
264
|
+
Suffix: {
|
|
265
|
+
type: "string",
|
|
266
|
+
description: "Name suffix of the contact up to 40 characters. To enable this field, ask Salesforce Customer Support for help.",
|
|
267
|
+
optional: true,
|
|
268
|
+
},
|
|
269
|
+
Title: {
|
|
270
|
+
type: "string",
|
|
271
|
+
description: "Title of the contact, such as CEO or Vice President.",
|
|
272
|
+
optional: true,
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
async run({ $ }) {
|
|
276
|
+
// See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm
|
|
277
|
+
// Contact object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contact.htm
|
|
278
|
+
|
|
279
|
+
if (!this.ContactId) {
|
|
280
|
+
throw new Error("Must provide ContactId parameter.");
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return await axios($, {
|
|
284
|
+
"method": "patch",
|
|
285
|
+
"url": `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/Contact/${this.ContactId}`,
|
|
286
|
+
"Content-Type": "application/json",
|
|
287
|
+
"headers": {
|
|
288
|
+
Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
|
|
289
|
+
},
|
|
290
|
+
"data": {
|
|
291
|
+
AccountId: this.AccountId,
|
|
292
|
+
AssistantName: this.AssistantName,
|
|
293
|
+
AssistantPhone: this.AssistantPhone,
|
|
294
|
+
Birthdate: this.Birthdate,
|
|
295
|
+
CanAllowPortalSelfReg: this.CanAllowPortalSelfReg,
|
|
296
|
+
CleanStatus: this.CleanStatus,
|
|
297
|
+
Department: this.Department,
|
|
298
|
+
Description: this.Description,
|
|
299
|
+
DoNotCall: this.DoNotCall,
|
|
300
|
+
Email: this.Email,
|
|
301
|
+
EmailBouncedDate: this.EmailBouncedDate,
|
|
302
|
+
EmailBouncedReason: this.EmailBouncedReason,
|
|
303
|
+
Fax: this.Fax,
|
|
304
|
+
FirstName: this.FirstName,
|
|
305
|
+
HasOptedOutOfEmail: this.HasOptedOutOfEmail,
|
|
306
|
+
HasOptedOutOfFax: this.HasOptedOutOfFax,
|
|
307
|
+
HomePhone: this.HomePhone,
|
|
308
|
+
IndividualId: this.IndividualId,
|
|
309
|
+
Jigsaw: this.Jigsaw,
|
|
310
|
+
LastName: this.LastName,
|
|
311
|
+
LeadSource: this.LeadSource,
|
|
312
|
+
MailingCity: this.MailingCity,
|
|
313
|
+
MailingState: this.MailingState,
|
|
314
|
+
MailingCountry: this.MailingCountry,
|
|
315
|
+
MailingPostalCode: this.MailingPostalCode,
|
|
316
|
+
MailingStateCode: this.MailingStateCode,
|
|
317
|
+
MailingCountryCode: this.MailingCountryCode,
|
|
318
|
+
MailingStreet: this.MailingStreet,
|
|
319
|
+
MailingGeocodeAccuracy: this.MailingGeocodeAccuracy,
|
|
320
|
+
MailingLatitude: this.MailingLatitude,
|
|
321
|
+
MailingLongitude: this.MailingLongitude,
|
|
322
|
+
MiddleName: this.MiddleName,
|
|
323
|
+
MobilePhone: this.MobilePhone,
|
|
324
|
+
OtherCity: this.OtherCity,
|
|
325
|
+
OtherCountry: this.OtherCountry,
|
|
326
|
+
OtherPostalCode: this.OtherPostalCode,
|
|
327
|
+
OtherState: this.OtherState,
|
|
328
|
+
OtherCountryCode: this.OtherCountryCode,
|
|
329
|
+
OtherStateCode: this.OtherStateCode,
|
|
330
|
+
OtherGeocodeAccuracy: this.OtherGeocodeAccuracy,
|
|
331
|
+
OtherLatitude: this.OtherLatitude,
|
|
332
|
+
OtherLongitude: this.OtherLongitude,
|
|
333
|
+
OtherPhone: this.OtherPhone,
|
|
334
|
+
OtherStreet: this.OtherStreet,
|
|
335
|
+
OwnerId: this.OwnerId,
|
|
336
|
+
Phone: this.Phone,
|
|
337
|
+
RecordTypeId: this.RecordTypeId,
|
|
338
|
+
ReportsToId: this.ReportsToId,
|
|
339
|
+
Salutation: this.Salutation,
|
|
340
|
+
Suffix: this.Suffix,
|
|
341
|
+
Title: this.Title,
|
|
342
|
+
},
|
|
343
|
+
});
|
|
344
|
+
},
|
|
345
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// legacy_hash_id: a_njiVg1
|
|
2
|
+
import { axios } from "@pipedream/platform";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "salesforce_rest_api-salesforce-update-opportunity",
|
|
6
|
+
name: "Update Opportunity",
|
|
7
|
+
description: "Updates an opportunity, which represents an opportunity, which is a sale or pending deal.",
|
|
8
|
+
version: "0.2.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
salesforce_rest_api: {
|
|
12
|
+
type: "app",
|
|
13
|
+
app: "salesforce_rest_api",
|
|
14
|
+
},
|
|
15
|
+
OpportunityId: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "ID of the Opportunity to update.",
|
|
18
|
+
},
|
|
19
|
+
AccountId: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "ID of the account associated with this opportunity.",
|
|
22
|
+
optional: true,
|
|
23
|
+
},
|
|
24
|
+
Amount: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products. Any attempt to update this field, if the record has products, will be ignored. The update call will not be rejected, and other fields will be updated as specified, but the Amount will be unchanged.",
|
|
27
|
+
optional: true,
|
|
28
|
+
},
|
|
29
|
+
CampaignId: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled. The User must have read access rights to the cross-referenced Campaign object in order to create or update that campaign into this field on the opportunity.",
|
|
32
|
+
optional: true,
|
|
33
|
+
},
|
|
34
|
+
CloseDate: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Required. Date when the opportunity is expected to close.",
|
|
37
|
+
optional: true,
|
|
38
|
+
},
|
|
39
|
+
ContractId: {
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "ID of the contract that's associated with this opportunity.",
|
|
42
|
+
optional: true,
|
|
43
|
+
},
|
|
44
|
+
CurrencyIsoCode: {
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "Available only for organizations with the multicurrency feature enabled. Contains the ISO code for any currency allowed by the organization.",
|
|
47
|
+
optional: true,
|
|
48
|
+
},
|
|
49
|
+
Description: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Text description of the opportunity. Limit: 32,000 characters.",
|
|
52
|
+
optional: true,
|
|
53
|
+
},
|
|
54
|
+
ForecastCategoryName: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "Available in API version 12.0 and later. The name of the forecast category. It is implied, but not directly controlled, by the StageName field. You can override this field to a different value than is implied by the StageName value.",
|
|
57
|
+
optional: true,
|
|
58
|
+
},
|
|
59
|
+
IsExcludedFromTerritory2Filter: {
|
|
60
|
+
type: "boolean",
|
|
61
|
+
description: "Used for Filter-Based Opportunity Territory Assignment (Pilot in Spring '15 / API version 33). Indicates whether the opportunity is excluded (True) or included (False) each time the APEX filter is executed.",
|
|
62
|
+
optional: true,
|
|
63
|
+
},
|
|
64
|
+
LeadSource: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "Source of this opportunity, such as Advertisement or Trade Show.",
|
|
67
|
+
optional: true,
|
|
68
|
+
},
|
|
69
|
+
Name: {
|
|
70
|
+
type: "string",
|
|
71
|
+
description: "Required. A name for this opportunity. Limit: 120 characters.",
|
|
72
|
+
optional: true,
|
|
73
|
+
},
|
|
74
|
+
NextStep: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "Description of next task in closing opportunity. Limit: 255 characters.",
|
|
77
|
+
optional: true,
|
|
78
|
+
},
|
|
79
|
+
OwnerId: {
|
|
80
|
+
type: "string",
|
|
81
|
+
description: "ID of the User who has been assigned to work this opportunity.If you update this field, the previous owner's access becomes Read Only or the access specified in your organization-wide default for opportunities, whichever is greater. If you have set up opportunity teams in your organization, updating this field has different consequences depending on your version of the API: For API version 12.0 and later, sharing records are kept, as they are for all objects. For API version before 12.0, sharing records are deleted. For API version 16.0 and later, users must have the Transfer Record permission in order to update (transfer) account ownership using this field.",
|
|
82
|
+
optional: true,
|
|
83
|
+
},
|
|
84
|
+
Pricebook2Id: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description: "ID of a related Pricebook2 object. The Pricebook2Id field indicates which Pricebook2 applies to this opportunity. The Pricebook2Id field is defined only for those organizations that have products enabled as a feature. You can specify values for only one field (Pricebook2Id or PricebookId)not both fields. For this reason, both fields are declared nillable.",
|
|
87
|
+
optional: true,
|
|
88
|
+
},
|
|
89
|
+
PricebookId: {
|
|
90
|
+
type: "string",
|
|
91
|
+
description: "Unavailable as of version 3.0. As of version 8.0, the Pricebook object is no longer available. Use the Pricebook2Id field instead, specifying the ID of the Pricebook2 record.",
|
|
92
|
+
optional: true,
|
|
93
|
+
},
|
|
94
|
+
Probability: {
|
|
95
|
+
type: "string",
|
|
96
|
+
description: "Percentage of estimated confidence in closing the opportunity. It is implied, but not directly controlled, by the StageName field. You can override this field to a different value than what is implied by the StageName. Note If you're changing the Probability field through the API using a partner WSDL call, or an Apex before trigger, and the value may have several decimal places, we recommend rounding the value to a whole number. For example, the following Apex in a before trigger uses the round method to change the field value: o.probability = o.probability.round();",
|
|
97
|
+
optional: true,
|
|
98
|
+
},
|
|
99
|
+
RecordTypeId: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "ID of the record type assigned to this object.",
|
|
102
|
+
optional: true,
|
|
103
|
+
},
|
|
104
|
+
StageName: {
|
|
105
|
+
type: "string",
|
|
106
|
+
description: "Required. Current stage of this record. The StageName field controls several other fields on an opportunity. Each of the fields can be directly set or implied by changing the StageName field. In addition, the StageName field is a picklist, so it has additional members in the returned describeSObjectResult to indicate how it affects the other fields. To obtain the stage name values in the picklist, query the OpportunityStage object. If the StageName is updated, then the ForecastCategoryName, IsClosed, IsWon, and Probability are automatically updated based on the stage-category mapping.",
|
|
107
|
+
optional: true,
|
|
108
|
+
},
|
|
109
|
+
SyncedQuoteID: {
|
|
110
|
+
type: "string",
|
|
111
|
+
description: "Read only in an Apex trigger. The ID of the Quote that syncs with the opportunity. Setting this field lets you start and stop syncing between the opportunity and a quote. The ID has to be for a quote that is a child of the opportunity.",
|
|
112
|
+
optional: true,
|
|
113
|
+
},
|
|
114
|
+
Territory2Id: {
|
|
115
|
+
type: "string",
|
|
116
|
+
description: "The ID of the territory that is assigned to the opportunity. Available only if Enterprise Territory Management has been enabled for your organization.",
|
|
117
|
+
optional: true,
|
|
118
|
+
},
|
|
119
|
+
TotalOpportunityQuantity: {
|
|
120
|
+
type: "integer",
|
|
121
|
+
description: "Number of items included in this opportunity. Used in quantity-based forecasting.",
|
|
122
|
+
optional: true,
|
|
123
|
+
},
|
|
124
|
+
Type: {
|
|
125
|
+
type: "string",
|
|
126
|
+
description: "Type of opportunity. For example, Existing Business or New Business.",
|
|
127
|
+
optional: true,
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
async run({ $ }) {
|
|
131
|
+
// See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm
|
|
132
|
+
// Opportunity object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_opportunity.htm
|
|
133
|
+
|
|
134
|
+
if (!this.OpportunityId) {
|
|
135
|
+
throw new Error("Must provide OpportunityId parameter.");
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return await axios($, {
|
|
139
|
+
"method": "patch",
|
|
140
|
+
"url": `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/Opportunity/${this.OpportunityId}`,
|
|
141
|
+
"Content-Type": "application/json",
|
|
142
|
+
"headers": {
|
|
143
|
+
Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
|
|
144
|
+
},
|
|
145
|
+
"data": {
|
|
146
|
+
AccountId: this.AccountId,
|
|
147
|
+
Amount: this.Amount,
|
|
148
|
+
CampaignId: this.CampaignId,
|
|
149
|
+
CloseDate: this.CloseDate,
|
|
150
|
+
ContractId: this.ContractId,
|
|
151
|
+
CurrencyIsoCode: this.CurrencyIsoCode,
|
|
152
|
+
Description: this.Description,
|
|
153
|
+
ForecastCategoryName: this.ForecastCategoryName,
|
|
154
|
+
IsExcludedFromTerritory2Filter: this.IsExcludedFromTerritory2Filter,
|
|
155
|
+
LeadSource: this.LeadSource,
|
|
156
|
+
Name: this.Name,
|
|
157
|
+
NextStep: this.NextStep,
|
|
158
|
+
OwnerId: this.OwnerId,
|
|
159
|
+
Pricebook2Id: this.Pricebook2Id,
|
|
160
|
+
PricebookId: this.PricebookId,
|
|
161
|
+
Probability: this.Probability,
|
|
162
|
+
RecordTypeId: this.RecordTypeId,
|
|
163
|
+
StageName: this.StageName,
|
|
164
|
+
SyncedQuoteID: this.SyncedQuoteID,
|
|
165
|
+
Territory2Id: this.Territory2Id,
|
|
166
|
+
TotalOpportunityQuantity: this.TotalOpportunityQuantity,
|
|
167
|
+
Type: this.Type,
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// legacy_hash_id: a_l0i2Pq
|
|
2
|
+
import { axios } from "@pipedream/platform";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "salesforce_rest_api-salesforce-update-record",
|
|
6
|
+
name: "Update Record",
|
|
7
|
+
description: "Updates a record of a given resource, its id and fields values. Use resource field values in the request data.",
|
|
8
|
+
version: "0.2.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
salesforce_rest_api: {
|
|
12
|
+
type: "app",
|
|
13
|
+
app: "salesforce_rest_api",
|
|
14
|
+
},
|
|
15
|
+
sobject_name: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Type of Salesforce standard object to update.",
|
|
18
|
+
},
|
|
19
|
+
sobject_id: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Id of the Salesforce standard object record to update.",
|
|
22
|
+
},
|
|
23
|
+
sobject: {
|
|
24
|
+
type: "object",
|
|
25
|
+
description: "Data of the Salesforce standard object record to update.\nSalesforce standard objects are described in [Standard Objects](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_list.htm) section of the [SOAP API Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_quickstart_intro.htm).",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
async run({ $ }) {
|
|
29
|
+
//See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm
|
|
30
|
+
return await axios($, {
|
|
31
|
+
"method": "patch",
|
|
32
|
+
"url": `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/${this.sobject_name}/${this.sobject_id}`,
|
|
33
|
+
"Content-Type": "application/json",
|
|
34
|
+
"headers": {
|
|
35
|
+
Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
|
|
36
|
+
},
|
|
37
|
+
"data": this.sobject,
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipedream/salesforce_rest_api",
|
|
3
|
+
"version": "0.3.3",
|
|
4
|
+
"description": "Pipedream Salesforce_rest_api Components",
|
|
5
|
+
"main": "salesforce_rest_api.app.mjs",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"pipedream",
|
|
8
|
+
"salesforce_rest_api"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://pipedream.com/apps/salesforce_rest_api",
|
|
11
|
+
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@pipedream/platform": "^0.9.0",
|
|
15
|
+
"salesforce-webhooks": "^1.1.4"
|
|
16
|
+
},
|
|
17
|
+
"gitHead": "e12480b94cc03bed4808ebc6b13e7fdb3a1ba535",
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
}
|
|
21
|
+
}
|