Saturday, May 30, 2020

Some important capabilities of Salesforce Lightning Connect


  • Read from OData - Compliant data sources without APEX. 
  • Associate external object records to Salesforce Account records. 
  • Write SOQL queries on external object.
  • We cannot write into Odata( but possible with apex adopter) and cannot write triggers on external objects(but possible with CDC).
  • Instead of copying the data into your org, Salesforce Connect accesses the data on demand and in real time. The data is never stale, and we access only what you need. We recommend that you use Salesforce Connect when:


  • You have a large amount of data that you don’t want to copy into your Salesforce org.
  • You need small amounts of data at any one time.
  • You want real-time access to the latest data.
Even though the data is stored outside your org, Salesforce Connect provides seamless integration with the Lightning Platform. External objects are available to Salesforce tools, such as global search, lookup relationships, record feeds, and the Salesforce app. External objects are also available to Apex, SOSL, SOQL queries, Salesforce APIs, and deployment via the Metadata API, change sets, and packages.

Some capabilities of Salesforce outbound messaging


  • Provide a session ID as part of the outbound message. 
  • Include the sessionId in your message if you intend to make API calls back to Salesforce from your listener.
  • Repeatedly send a SOAP notification for up to 24 hours until an acknowledgement is received. 
  • Build integration components without the Use of APEX
  • A single SOAP message can include up to 100 notifications. Each notification contains the object ID and a reference to the associated sObject data.
  • If the information in the object changes after the notification is queued but before it is sent, only the updated information will be delivered.
  • If the endpoint is unavailable, messages will stay in the queue until sent successfully, or until they are 24 hours old. After 24 hours, messages are dropped from the queue.
  • Because a message may be delivered more than once, your listener client should check the notification IDs delivered in the notification before processing.
  • Outbound messaging uses the notifications() call to send SOAP messages over HTTP(S) to a designated endpoint when triggered by a workflow rule.
  • Below diagram will give more clear picture of outbound messaging.
outbound messaging workflow diagram


After you set up outbound messaging, when a triggering event occurs, a message is sent to the specified endpoint URL. The message contains the fields specified when you created the outbound message. Once the endpoint URL receives the message, it can take the information from the message and process it. To do that, you need to examine the outbound messaging WSDL.

Some Important capabilities of Salesforce to Salesforce


  • Automatically publish data from the publisher org. 
  • Manually consume data into the consumer org
  • Publish data from the publisher's Account object to the consumer's Customer__c object
  • System administrators can share all records, but most users can only forward records that they (or their subordinates) own.

  • You can stop sharing a related record from its parent record. Select the parent record. In the related list of the record you want to stop sharing, click Manage Connections in the Sent Connection Name column. Then, select the connection(s) that you want to stop sharing within the Selected Connections list. Click the Remove arrow to move the connection(s) to the Available Connections list. Click Save.
  • To stop sharing a record, view the record and click Stop Sharing in the External Sharing related list. You can only stop sharing records that you or your subordinates own. When you stop sharing the record with a connection, changes to the record in your organization are not reflected on the record in the connection's organization. The shared record is not deleted from the other organization.
  • To stop sharing a case comment or attachment, you must make the records private.
For more considerations and capabilities click here: S2S Considerations

Web-to-Lead limit considerations before we choose it.

In Professional, Enterprise, Unlimited, Performance, and Developer Edition organizations, you can capture up to 500 leads in a 24–hour period. 

If your organization exceeds its daily Web-to-Lead limit, the Default Lead Creator (specified in the Web-to-Lead setup page) receives an email containing the additional lead information. If your company regularly exceeds the Web-to-Lead limit, click Help & Training at the top of any page and select the My Cases tab to submit a request for a higher limit directly to Salesforce.
When your organization reaches the 24–hour limit, Salesforce stores additional requests in a pending request queue that contains both Web-to-Case and Web-to-Lead requests. The requests are submitted when the limit refreshes. The pending request queue has a limit of 50,000 combined requests. If your organization reaches the pending request limit, additional requests are rejected and not queued. Your administrator receives email notifications for the first five rejected submissions. Contact Salesforce Customer Support to change your organization's pending request limit.

Canvas Life Cycle Handler to change url Dynamically and provide authorization information via the signed Request

You can control your app lifecycle by providing an implementation of the Canvas.CanvasLifecycleHandler Apex interface that Salesforce can use.
The Apex Canvas.CanvasLifecycleHandler interface provides methods and callbacks for customizing app lifecycle behavior. Salesforce will use your implementation at runtime to let you run custom code. Use the following steps to create an implementation of the Canvas.CanvasLifecycleHandler interface.

  1. From Setup, enter Apex Classes in the Quick Find box, then select Apex Classes.
  2. Click New to create a Apex class.
  3. Create an Apex class that implements the Canvas.CanvasLifecycleHandler interface. You must implement the excludeContextTypes() and onRender() methods. Here’s a template example:public class


MyCanvasLifecycleHandler implements Canvas.CanvasLifecycleHandler {

    public Set<Canvas.ContextTypeEnum> excludeContextTypes()
{ Set<Canvas.ContextTypeEnum> excluded = new Set<Canvas.ContextTypeEnum>(); // Code goes here to add items to excluded list // that should be excluded from Context data return excluded; }

 public void onRender(Canvas.RenderContext renderContext) { // Code goes here to customize behavior when the app is rendered } }


    >> After you’ve finished adding your code, save the Apex class
    >> Optionally test your implementation by using the Canvas.Test class
   >>  To let Salesforce know which implementation to use for your app, associate your Apex class with your app.

To modify the default behavior of the signed request, you need to provide an Apex class that implements Canvas.CanvasLifecycleHandler.onRender() and associate this class with your canvas app. In your onRender() implementation, you can control app behavior with custom code.
Salesforce calls your implementation of onRender() just before your app is rendered. Current context information is passed to this method in the Canvas.RenderContext parameter.
In your onRender() implementation, you can retrieve the following context information.
  • Application context data, such as the canvas app name, URL, version, and namespace.
  • Environment context data, such as the display location and sublocation, object field names, and custom parameters.
You can set the following context information.
  • The portion of the canvas app URL after the app domain.
  • The list of object fields for which Salesforce will return Record context data if the canvas app appears on an object page. One way a canvas app can appear on an object page is if the canvas app appears on a Visualforce page through the use of the <apex:canvasApp> component and that Visualforce page is associated with an object.
  • The custom parameters that are passed to the canvas app.
You can also use Canvas.CanvasRenderException to present an error message to the user in the Salesforce by throwing a Canvas.CanvasRenderException.
Here’s an example onRender() implementation that:
  • Checks the app version information and, if the version is unsupported, throws a CanvasRenderException.
  • Overrides the current canvas app URL, appending ‘/alternatePath’ to the domain portion of the original URL.
  • Sets the list of object fields to include Name, BillingAddress, and YearStarted, anticipating that the canvas app will appear on the Account page.
  • Overrides the set of custom parameters by adding a new ‘newCustomParam’ parameter. Note that the current set of parameters is first retrieved and cached locally. The new parameter is added to the cached list to ensure that you don’t lose the current set of custom parameters when you call setParametersAsJSON().

  • public void onRender(Canvas.RenderContext renderContext) {

    // Get the Application and Environment context from the RenderContext
    Canvas.ApplicationContext app = renderContext.getApplicationContext();
    Canvas.EnvironmentContext env = renderContext.getEnvironmentContext();

    // Check the application version
    Double currentVersion = Double.valueOf(app.getVersion());
    if (currentVersion <= 5){
        // Versions lower than 5 are no longer supported in this example
        throw new Canvas.CanvasRenderException('Error: Versions earlier than 5 are no longer supported.');
    }

    // Override app URL, replacing portion after domain with '/alternatePath'
    app.setCanvasUrlPath('/alternatePath');

    // Add Name, BillingAddress and YearStarted to fields 
    // (assumes we'll run from a component on the Account detail page)
    Set<String> fields = new Set<String>{'Name','BillingAddress','YearStarted'};
    env.addEntityFields(fields);

    // Add a new custom param to the set of custom params
    // First, get the current custom params
    Map<String, Object> previousParams = 
        (Map<String, Object>) JSON.deserializeUntyped(env.getParametersAsJSON());
    // Add a 'newCustomParam' to our Map
    previousParams.put('newCustomParam','newValue');
    // Now, replace the parameters
    env.setParametersAsJSON(JSON.serialize(previousParams));
}

Friday, May 8, 2020

Generate a Certificate file and Private Key


   Generate a Certificate file and Private Key

An example of how to create a certificate:


1.   keytool -keysize 2048 -genkey -alias mycert -keyalg RSA -keystore ./mycert.jks

2.   keytool -importkeystore -srckeystore mycert.jks -destkeystore mycert.p12 -deststoretype PKCS12

3.  openssl pkcs12 -in mycert.p12 -out key.pem -nocerts –nodes

4.  keytool -export -alias mycert -file mycert.crt -keystore mycert.jks -rfc


If you don't have openssl installed click on below link and download now.


You will get one executable file, click on it and follow the wizard steps until you finish it.


Add openssl to your environment variables.My system path settings are as below. Follow the same in your system as well.

System variable settings:


bin folder path should be given in the environment path variable.


User variable settings.



OPENSSL_CONF=yourpath/openssl.cfg

Once these settings are done, go back to the cmd and type openssl. You should see >OpenSSL as output. If the settings are incorrect, you will get error message.

KeyTool.

Keytool is part of your Jave JDK. go to the path of keytool and run the keytool commands, you don't need to do anything special for keytool.











c