Skip to content

Commit d67ab32

Browse files
committed
fix(triggers): address PR review — remove non-TSDoc comment, fix generic webhook instructions
1 parent ce78227 commit d67ab32

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

apps/sim/blocks/blocks/salesforce.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
523523
],
524524
},
525525
},
526-
// Trigger subBlocks
527526
...getTrigger('salesforce_record_created').subBlocks,
528527
...getTrigger('salesforce_record_updated').subBlocks,
529528
...getTrigger('salesforce_record_deleted').subBlocks,

apps/sim/triggers/salesforce/utils.ts

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,29 @@ export const salesforceTriggerOptions = [
1919
* Flow HTTP Callouts or Outbound Messages manually.
2020
*/
2121
export function salesforceSetupInstructions(eventType: string): string {
22-
const instructions = [
23-
'Copy the <strong>Webhook URL</strong> above.',
24-
'In Salesforce, go to <strong>Setup → Flows</strong> and click <strong>New Flow</strong>.',
25-
`Select <strong>Record-Triggered Flow</strong> and choose the object and <strong>${eventType}</strong> trigger condition.`,
26-
'Add an <strong>HTTP Callout</strong> action — set the method to <strong>POST</strong> and paste the webhook URL.',
27-
'In the request body, include the record fields you want sent as <strong>JSON</strong> (e.g., Id, Name, and any relevant fields).',
28-
'Save and <strong>Activate</strong> the Flow.',
29-
'Click <strong>"Save"</strong> above to activate your trigger.',
30-
'<em>Alternative: You can also use <strong>Setup → Outbound Messages</strong> with a Workflow Rule, but this sends SOAP/XML instead of JSON.</em>',
31-
]
22+
const isGeneric = eventType === 'All Events'
23+
24+
const instructions = isGeneric
25+
? [
26+
'Copy the <strong>Webhook URL</strong> above.',
27+
'In Salesforce, go to <strong>Setup → Flows</strong> and click <strong>New Flow</strong>.',
28+
'Select <strong>Record-Triggered Flow</strong> and choose the object(s) you want to monitor.',
29+
'Add an <strong>HTTP Callout</strong> action — set the method to <strong>POST</strong> and paste the webhook URL.',
30+
'In the request body, include the record fields you want sent as <strong>JSON</strong> (e.g., Id, Name, and any relevant fields).',
31+
'Repeat for each object type you want to send events for.',
32+
'Save and <strong>Activate</strong> the Flow(s).',
33+
'Click <strong>"Save"</strong> above to activate your trigger.',
34+
]
35+
: [
36+
'Copy the <strong>Webhook URL</strong> above.',
37+
'In Salesforce, go to <strong>Setup → Flows</strong> and click <strong>New Flow</strong>.',
38+
`Select <strong>Record-Triggered Flow</strong> and choose the object and <strong>${eventType}</strong> trigger condition.`,
39+
'Add an <strong>HTTP Callout</strong> action — set the method to <strong>POST</strong> and paste the webhook URL.',
40+
'In the request body, include the record fields you want sent as <strong>JSON</strong> (e.g., Id, Name, and any relevant fields).',
41+
'Save and <strong>Activate</strong> the Flow.',
42+
'Click <strong>"Save"</strong> above to activate your trigger.',
43+
'<em>Alternative: You can also use <strong>Setup → Outbound Messages</strong> with a Workflow Rule, but this sends SOAP/XML instead of JSON.</em>',
44+
]
3245

3346
return instructions
3447
.map(

0 commit comments

Comments
 (0)