Integration Flashcards
You use Salesforce to manage customer cases. A customer service rep is on the phone with a customer working on a case. The customer makes a payment and the customer service rep needs to see a real-time update in Salesforce from the payment processing application.
Which pattern does this describe?
UI Update based on Data Changes
What is the recommended solution for the UI Updates based on Data Changes Pattern?
The Salesforce Streaming API using:
1- A push topic
2- Bayeux/CometD JS implementation
3- VF or Lightning component
4- JS lib included as a static resoruce
What are the benefits of using the Streaming API to update the UI based on changes?
No need to write a custom poller
No need to have the user manually poll
What are the limitations of using the Streaming API to update the UI based on changes?
1- Delivery of notifications isn’t guaranteed
2- Order of notifications isn’t guaranteed
3- Notifications aren’t generated from record changes made by Bulk API
A telecommunications company uses Salesforce to manage customer cases. The customer service managers want to be notified when a case is successfully closed by one of their customer service reps.
Describe what the solution for this use case would look like.
- Create a PushTopic that sends a notification when a case is saved with a status of Closed and resolution of Successful
- Create custom UI and subscribe the UI to the PushTopic Channel
- Implement logic in the UI that shows alerts generated by that managers reps
What are two implementation drivers for Streaming API solutions?
- Appliations that poll frequently
- General notification of data changes in the org.
T/F: A PushTopic can define specific criteria about which it will notify subscribers.
TRUE
What is Bayeaux?
A Protocol for transporting asynchronous messages, primarily over HTTP.
What is CometD?
A scalable HTTP-based routing bus that uses an AJAX push technology pattern known as Comet. It implements the Bayeaux protocol.
What five CometD methods are supported by the Streaming API?
Connect
Disconnect
Handshake
Subscribe
unsubscribe
What are two major differences between a PushTopic and a Change Data Capture?
PushTopic send only specific fields, wheereas CDC send all of the fields that changed.
CDC also sends details of the change in the header
What is the retention period for a PushTopic Event?
24 hours
What is the retention period for a Change Data Capture Event?
72 hours
What is the retention period for a regular Platform Event?
24 Hours
What is the retention period for a High-volume Platform Event?
72 hours
What is the retention period for a Generic Event?
1 Day
What are Generic Events?
Generic events send custom notifications that are not tied to Salesforce Data Changes
What is a replay ID and what is it’s impact on Event Durability?
The ReplayID is a value populated by the system to represent the event’s position in the event stream.
The replay even can be used to retrieve events that are within the retention window
True/False:
A subscriber can choose which events to retrieve as long as the event is within its retention window or starting after a particular event.
TRUE
What events will a subscriber receive by default after subscribing to a messaging queue?
The default is to receive only the new events sent after subscribing.
If there are ten messages in a queue, and a subscriber tries to replay events using the replayId of -1, what events will the subscriber receive?
the subscriber will receive all events after the client subscribes.
If there are ten messages in a queue, and a subscriber tries to replay events using the replayId of -2, what events will the subscriber receive?
the subscriber will receive all events that are within the retention window + all new events.
If there are ten messages in a queue, and a subscriber tries to replay events using the replayId of 5, what events will the subscriber receive?
the subscriber will receive events 6-10 (NOT 5) + all new events
What is a PushTopic?
What’s included?
A PushTopic triggers notifications for changes to Salesforce records resulting from a create, update, delete or undelete.
The PT Notification is based on the criteria specified in the PushTopic record and the SOQL query defined to retrieve the notification.
What is a Platform Event?
A Platform Event represents the definition of the custom data to be sent in a platform event message.
What is a Change Data Capture Event?
A CDC triggers notification for changes in Salesforce records resulting from a create, update, delete or undelete operation. All changed fields are sent in the notification, and information about the change can be found in the header
Describe the relationship between an event, notification, subscription channel and the event bus
An event occurs as the result of a CRUD operation, and triggers a notification, which is published to the channel of an event bus for consumption
You use Salesforce to track leads, manage your pipeline, create opportunities, and capture order details that convert leads to customers. However, Salesforce isn’t the system that contains or processes orders. Orders are managed by an external (remote) system. But sales reps want to view and update real-time order information in Salesforce without having to learn or use the external system.
What pattern describes the best solution?
Data Virtualization
What are the two solutions for Data Virtualization on Saleforce?
Salesforce Connect (best)
Request/Reply (suboptimal)
Describe how Salesforce Connect works.
Salesforce Connect maps data tables in an external system to external objects in your org.
Salesforce Connect uses a live connection to external data to always keep external objects up-to-date.
What protocols must the external system support for Salesforce Connect to be an option?
Odata 2.0 and Odata 4.0
How can 2 Salesforce orgs be connected to share data using Data Virtualization?
Using a cross org adapter
How does the Salesforce cross-org adapter communicate between orgs?
The orgs connect directly to each other, and send data using the Salesforce REST API
If Odata and cross-org adapters are not suitable, what other option can be used to implement Salesforce Connect?
A custom Apex adapter can be created with the Apex Connector Framework
What volume considerations are related to Data Virtualization in Salesforce?
The Data Virtualization pattern is primarily used for small volume/real-time activities.
What are the data state management concerns when using the Data Virtualization pattern?
The remote system stores either the Salesforce record ID or some other unique surrogate key from the record.
The call to the remote process returns the unique key from the application, and Salesforce stores that key value in a unique record field.
External Objects supports lookup relationships similarly to custom and standard objects.
What is the relationship name if a standard object is the parent, the external object is the child and the SF ID is the field used for mapping?
Lookup Relationship
External Objects supports lookup relationships similarly to custom and standard objects.
What is the relationship name if a custom object is the parent, the external object is the child and the SF ID is the field used for mapping?
Lookup Relationship
External Objects supports lookup relationships similarly to custom and standard objects.
What is the relationship name if an external object is the parent, an external object is the child and the SF ID is the field used for mapping?
Lookup Relationship
External Objects supports lookup relationships similarly to custom and standard objects.
What is the relationship name if an external object is the parent, an external object is the child and External ID is the field used for mapping?
External Lookup Relationship
External Objects supports lookup relationships similarly to custom and standard objects.
What is the relationship name if an external object is the parentt, a custom object is the child and External ID is the field used for mapping?
External Lookup Relationship
External Objects supports lookup relationships similarly to custom and standard objects.
What is the relationship name if an external object is the parent, a standard object is the child and External ID is the field used for mapping?
External Lookup Relationship
External Objects supports lookup relationships similarly to custom and standard objects.
What is the relationship name if a standard object is the parent, the external object is the child and a custom external ID is the field used for mapping?
Indirect Lookup Relationship
External Objects supports lookup relationships similarly to custom and standard objects.
What is the relationship name if a custom object is the parent, the external object is the child and a custom external ID is the field used for mapping?
Indirect Lookup Relationship
What integration is necessary in order to allow SF users to search external files?
Files Connect
What are the steps required to setup Files Connect?
Enable Files Connect
Setup an authentication provider for the source system.
If the call to the remote system is synchronous and Salesforce has to process the response as part of the same transaction as the initial call what pattern should you select?
Request/Reply
What are Enhanced External Services
Enhanced External Services allows you to invoke an externally hosted service in a declarative manner (no code required).
For the request/reply integration pattern, what are the best fit implementations?
Enhanced External Services
Custom Lightning Component
Visual Force Page/Button
For custom implementations of the Request/Reply pattern, what is the recommendation if the endpoint potentially has high-latency response?
Use a continuation
What is the recommended integration pattern for initiating a call out from an Apex Trigger?
Fire & Forget
What is the recommended integration pattern for initiating a call out from an Apex Batch?
Fire & Forget
How should an error be handled and recovered in Salesforce when using the Request/Reply integration pattern?
Salesforce should handle the error (display message, etc).
The change should not be committed in SF until a successful response is received from the remote system (via retry).
What is idempotency?
An API call or operation is idempotentif it has the same result no matter how many times it is applied.
What is the risk of an operation not being idempotent?
Data integrity issues
True/False:
One-way SSL is enabled by default for Apex REST & Apex SOAP callouts..
TRUE
Salesforce has a configurable timeout of up to ____ seconds for calls from Apex.
120 Seconds
Options to mitigate the risk of a request/reply timeout include:
Setting the timeout of the external callout to five seconds
Using a continuation in Visualforce or Lightning Components to handle long-running transactions
What are the endpoint considerations for Apex SOAP callouts?
The endpoint must be able to receive a web service call via HTTP. Salesforce must be able to access the endpoint over the public Internet.
This solution requires that the remote system is compatible with the standards supported by Salesforce
What are the endpoint considerations for Apex REST callouts?
The endpoint must be able to receive HTTP calls. Salesforce must be able to access the endpoint over the public Internet.
You can use Apex HTTP callouts to call REST services using the standard GET, POST, PUT, and DELETE methods.
What are the two options for managing the state of data passed between two systems via outbound request/reply transactions?
Salesforce stores the remote system primary or unique surrogate key for the record.
The remote system stores the SF unique record ID or some other unique Surrogate key
A utility company uses Salesforce and has a separate system that contains customer billing information. They want to display the billing history for a customer account without storing that data in Salesforce. They have an existing web service that returns a list of bills and the details for a given account, but can’t display this data in a browser. The utility company is on SF Classic.
What pattern should be implemented?
What is the calling mechanism?
Who is responsible for error management in this scenario?
How is the state of the record maintained in this example?
Pattern: Request/Reply
Calling Mechanism: Visual Force
Error Management: SF
Record state: remote system account info on the Account record
You use Salesforce to track leads, manage your pipeline, create opportunities, and capture order details that convert leads to customers. However, Salesforce isn’t the system that holds or processes orders. After the order details are captured in Salesforce, an order must be created in the remote system, which manages the order through to its conclusion.
What is the correct pattern to implement?
Fire & Forget
For the fire & forget integration pattern, what are the best fit implementations?
What are the good fit implementations?
Best:
Process-driven Platform Events
Good:
Customization-driven Platform Events
Workflow Driven Outbound Messaging
Outbound Messaging w/callbacks
When an external app uses the API or a native Salesforce app uses Apex to publish the event message, how does Salesforce respond?
a trigger on that event is fired
What is the recommended solution to trigger a remote process from an insert or update of a record or event?
Process-driven Platform Events
A software system sends events containing information about printer ink cartridges. Subscribers can subscribe to the events to monitor printer ink levels and place orders to replace cartridges with low ink levels.
How is the remote system notified of these messages?
External apps can listen to event messages by subscribing to a channel through CometD
A software system sends events containing information about printer ink cartridges. Subscribers can subscribe to the events to monitor printer ink levels and place orders to replace cartridges with low ink levels.
How is native Salesforce functionality notified of these messages?
Platform apps, such as Visualforce pages and Lightning components, can subscribe to event messages with CometD
How are Platform Events consumed on the Salesforce platform?
Apex Trigger
How can a remote system retrieve data from or send data to Salesforce without explicitly authenticating?
Outbound messages send a session id which can be used as an authentication token in a callback
Why are Custom Lightning/VisualForce, Triggers and Batch Apex suboptimal solutions for using a Fire & Forget solution?
All three require customizations. There are event-driven implementations that could be better alternatives.
Assuming a fire and forget integration triggered by an Apex callout, if Salesforce is able to successfully transact the message /event, where should the error be handled?
How can the transaction be recovered?
The error should be handled in the remote system, and should be recovered using a custom retry.
Assuming a fire and forget integration triggered by an Outbound Message, if Salesforce is able to successfully create the message, but the remote system doesn’t acknowledge it, where should the error be handled?
How can the transaction be recovered?
The exception should be handled by the remote system. Recovery is handled automatically because the OBM will try to send the message for up to 24 hours.
Assuming a fire and forget integration triggered by a Platform Event, if Salesforce is able to successfully transact the message /event, where should the error be handled?
How can the transaction be recovered?
If the PE is created successfully, then any errors would need to be resolved in the remote system. Recovery would consist of the remote system replaying any missed events within 72 hours.
What five things can the Lightning SOAP API be used for?
Publish events to notify the Org
Query data
CRUD data
Obtain metadata from the org
Run utlities to perform administrative tasks
What is an External Service?
External Services are a Salesforce integration product that declaritively connects external REST APIs using the Open API Standards
What is an API spec?
- A human-readable file that External Services consumes to generate invocable actions
- A humna-readable file that flow creates for the parameters needed in the definition when your flow runs
- A human-readable file definition that flow outputs at the end of a flow interview
- A machine-readable external service that must be compiled
From the perspective of Salesforce/Salesforce Architecture
A human-readable file that External Services consume to generate invocable actions
Which are elements of a valid schema for External Services:
- Response code output contains complex objects, paramters have names
- Response code output does not contain complex objects, any method can be used.
- Schema adheres to OpenAPI specification, parameters have names
- Schema has less than 100K characters, parameters use complex named object
Schema adheres to OpenAPI specification, parameters have names
What might cause you API Spec to fail registration?
- It includes a name that is not reserved
- It includes all supported methods
- It exceeds the limit for total number of actions
- Parameters have descriptive names
It exceeds the limit for total number of actions
What prereq has to be completed before registering an external service?
- Give the service provider the named credential so that it can access Salesforce
- Ensurte that the remote credential the service provider uses has endpoints
- Define a named credential and authorize endpoint access
- Create your remote credential and export it.
Once you have the API spec…
Define a named credential and authorize endpoint access
What can you do after you successfully register an external service?
- Validate your Apex actions using the dev console
- Select the named credential you defined so that the remote credential can access the schema
- Invoke actions based on the external source via a flow
- Invoke flows from the External Services Wizard
Invoke actions based on the external source via a flow
Which is true about the Apex actions generated by External Svcs.
- They can be mapped to the flow you created before registering your service
- They are mapped directly from the operations in the schema definition and are visible in the wizard
- They are available only within the wizard to protect service security
- They become obsolete once you run the wizard along with a flow
They are mapped directly from the operations in the schema definition and are visible in the wizard
What are 4 common reasons to integrate apps on Heroku w/Salesforce?
- Data Replication
- Data proxies
- Custom UIs
- External processes
What is Data Replication?
(in context of Salesforce)
Copying or synchronizing data between Salesforce and another system.
What are data proxies?
Data proxies aggregate different data stores that are read only and on demand.
What Heroku product is used for data replication & data proxies?
Heroku Connect
Which is not an advantage of data replication vs. Data proxies?
- A replicated data set offloads processing and requersts from an origin data server
- A replicated data set is always and immediately in sync with origin data
- A replicated data set reduces data access latency
- A replicated data set supports bidirectional writes
A replicated data set is always and immediately in sync with origin data
You can use Salesforce Connect to proxy which types of data sources?
- OData 2.0 & 4.0
- REST W/JSON payloads
- REST w/XML Payloads
- SOAP
- All of the above
All of the above
Which technology do Salesforce REST APIs use for authentication?
- Pre-shared keys
- Basic usernames & passwords
- OAuth
- SAML
OAuth
Callouts from Salesforce to Heroku can be made using:
- Web sockets
- Apex triggers or outbound messages
- Message bus
- Corba
Apex Triggers or outbound messages
Heroku Connect can be used for:
- One-way data replication
- Bidirectional data replication
- Data proxy with Salesforce connect
- All of the above
All of the above
How does Heroku Connect work with Salesforce Authentication?
- A single integration user’s credentials are stored
- OAuth provides Heroku connect with API tokens after the user authorizes the Heroku Connect application on Salesforce
- SAML authorizes Heroku Connect to make API calls
- The end user of a Heroku app authorizes Heroku Connect via OAuth
OAuth provides Heroku connect with API tokens after the user authorizes the Heroku Connect application on Salesforce
Heroku Connect data replication happens:
- Instantly in both directions
- Near real time in both directions
- Near real time for writes to Salesforce, and on a 30- secont poling window for writes to Heroku Postgres
- Near real time for writes to Salesforce and either on a poling window or near real time for writes to Heroku Postgres (depending on user config)
Near real time for writes to Salesforce and either on a poling window or newar real time for writes to Heroku Postgres (depending on user config)