SK SKYVVA Documentation

2. How to push data from Salesforce by using a button, trigger, the process build process?

Learning Objective: After completing this unit, you’ll be able to:

Introduction

To show the different technology which can be use to push data to the external client by using Skyvva. For example, different possibility  like: Using Trigger, Process Builder process, Flow, Apex class to send data out. The callout methods are using to send data from salesforce to external system (SFDC to SAP/SAP-PI) through interface outbound. The Service only sends one record/children per request to SAP. To invoke callout from apex trigger the method invokeCallout(interfaceId, ids, ‘AUTO’) is recommended.

Why we use button, trigger, the process build process to push data from salesforce?

[su_box title="Note" box_color="#2a8af0" title_color="#000000"]The lightning version does not support with custom button, So we need to implement our tool to generate a script of the lightning component to use with Quick Action instead of a button. [/su_box]

Process Builder

Process Builder is a Salesforce’s point-and-click tool that lets you easily automate if/then business processes and see a graphical representation of your process as you build. Every process consists of a trigger, at least one criteria node, and at least one action. You can configure immediate actions or schedule actions to be executed at a specific time. To keep things simple, this unit focuses on the most common process type: Record Change, which mean the process, will start when the records are created or edited. The configuration To be able to execute callout, you have enter interface page detail and scroll down to Runtime Configuration- Outbound section then check flag “Use Skyvva Outbound Scheduler”.

[su_box title="Note" box_color="#FF0000" title_color="#000000"]

This part is mainly explain the process of creating the process builder in order to create change pointer records. To build process builder, you can follow the steps below:

  1. Name the Criteria
  2. Choose Formula evaluate to true
  3. Build Formula by insert the Function and Field then click Save .

Add the actions to execute when the criteria are met by:

  1. Select the Action Type: Apex
  2. Select the Action Name: Create CP Record
  3. Select Apex Class: SKYVVA Callout/Create CP. When you section it, some of dropdown list will appear for you to choose. Then click Add Row to add 2 more.
To be able to execute process builder, just click on Activate button.

To monitor change pointer records: You can check the change pointer records in CDC Control Board.

Trigger

When a record is changed the change data should sent. Whenever a record e.g. an account in Salesforce is changed this change are sent immediately to the client. This is the opposite way to the batch/async. variant. Follow the given steps:

Button

How to use Flow to call our invokeCallOutV3() API ?

A flow is the part of Salesforce Flow that collects data and performs actions in your Salesforce org or an external system. Salesforce Flow provides two types of flows: screen flows and Autolaunched flows. To automate a business process that collects data from people, use a screen flow. To launch a flow internally when a record changes or when a user clicks a button, use an Autolaunched flow. Case 1:  Flow executes SKYVVA apex to create change pointer Description: Provide the possibility to invoke SKYVVA Api to create changed pointer or process outbound interface from  Flow (record triggered flow). Create Change Pointer Record [su_box title="Note" box_color="#2a8af0" title_color="#000000"]User must have outbound interface and check flag Use SKYVVA Outbound Scheduler on that interface [/su_box] Expectation: When we update Billing City, Flow will be creating CP record that show on CDC Control Board

- Enter Flow in the Quick Find Box, and select Flow

Case 2: Flow executes skyvva apex to execute callout Execute invoke callout old version by default. However, user can execute outbound V3 by specify the version number (3) by including the input value for Expectation:  When we update Billing City, Flow will be sent to external system.

- At the end click Activate button on the right side

Result: After update Billing City Process Builder will be sent to external system

Now user learn how to invoke SKYVVA Api to create changed pointer or process outbound interface from  Flow (record triggered flow).

How to use Quick action ?

The lightning version does not support with custom button, So we need to implement our tool to generate a script of the lightning component to use with quick action instead of a button. We have a tool Skyvva Trigger which generates SKYVVA Trigger scripts where we have a trigger type "Quick action". Pre- Requisite:-

Follow steps as shown below:

Open this article in the interactive viewer →