When Salesforce is life!

Author: Claudio Marzorati

Claudio is a Senior Salesforce Developer @ Sintegra s.r.l. (Milan). He worked with different retails that allowed him to increase his technical background on several aspects.
From analysis, to development, to the direct relationship with the customer, nothing is left to chance.
Other passions are running and travels!

Salesforce Winter ’20 Highlights

Our week’s trailblazer is Claudio Marzorati, who will be listing some of his favorite Winter’20 Salesforce platform release.

Claudio is a Senior Salesforce Developer @ Sintegra s.r.l. (Milan). He worked with different retails that allowed him to increase his technical background on several aspects.
From analysis, to development, to the direct relationship with the customer, nothing is left to chance.
Other passions are running and travels!


In this article I summarize the most important features introduced in the new release.

General Update

Access the Recycle Bin in Lightning Experience

You no longer have to switch to Salesforce Classic to access the Recycle Bin. You can now view, restore, and permanently delete the items in your Recycle Bin and the org Recycle Bin. Now you can access the Recycle Bin by selecting it in the App Launcher under All Items or personalizing your navigation bar. Or add the Recycle Bin tab for your org in the Lightning App Builder.

View Records by Topic on the Topic Detail Page

If you enable topics from your organization, now you can view records by topics as in the below image.

You must enable a permission in your profile to use topics, as below. Actually (before Winter ’20) you have to navigatore from Setup – Topics for Object Settings in order to enable object by object which fields are candidate for topics detection.

Save Ink and Paper with Printable View for Lists

Printable view for List View is finally available also in Lightning Experience.

Manage Security Contacts for Your Org

Keeping key members of your org in the know about security incidents is important to us. You can now designate your org’s security contacts in Salesforce Help so that if an information security incident impacts your org, your contacts are notified. From Salesforce Help, click Support & Services Manage next to Customer Security Contacts on the My Profile Settings tile. Here you can add, edit, or delete the email addresses of your security contacts.

Mobile APP

New Mobile App arrives the week of October 14, 2019
Give Your Users Custom Record Pages on Their Phones

Custom Lightning record pages are no longer restricted to desktop. Now you can create record pages tailored to the needs of your mobile users that they see only when viewing the page on a phone. When you create a record page in the Lightning App Builder, you can select a page template that matches the form factor that you’re designing the page for. Preview what the page looks like on different devices using the form factor switcher. When you activate your page, you can choose which form factors to make the record page available on: phone, desktop, or both, depending on which form factors its template supports.

List and Related List Components Are Optimized for the New Salesforce Mobile App

We updated the List View, Related List – Single, Related Lists, and Related List Quick Links components to support mobile navigation and the new Salesforce mobile app. When you place the List View component on a record page, a View More button loads more records in batches, so you can easily get more records or scroll to the information you want. The Related Lists component groups all your related lists in one section and no longer includes News and Twitter. The Related Lists component also uses a View More button for efficient navigation.

File

Set File Sharing to Inherit Record Settings

When attaching files to records, you can have the files inherit the sharing settings of those records. For instance, when a user can edit a record, you want them to be able to edit the files on that record, too. Now you can set the default sharing permissions on files that are attached to records. The preference lets files follow the sharing settings of the record.

For new orgs this option is enabled by default, in other case it must be activated from Setup – Salesforce Files – General Settings, as below.

With this option you can inherit the sharing setting of a record. For example a file attached before you enable this option appear as below

Then became

Remove a File from a Record Without Deleting It Everywhere

Sales Cloud

Contacts: Customize Opportunity Contact Roles for Better Tracking and Reporting

Opportunity contact role customization options give you the flexibility to track and attribute revenue to roles, titles, and individuals. With custom fields and page layouts, validation rules, and Apex triggers, you can design an Opportunity Contact Role to match your specific sales and reporting processes. You can capture new data, such as titles and roles, to help your sales reps be more efficient in targeting the right contacts.

Accounts: Customize Account Teams to Better Support Team Selling

Team selling involves complex account relationships. Now you can manage those relationships better in Salesforce. Collect more information by adding custom fields, buttons, and links to account team layouts. Use validation rules, Apex triggers, Process Builder (NEW), and workflow rules (NEW) with account teams to help keep data clean and minimize manual data entry. You can now report on account teams, too.

View Opportunities Owned by Your Team with One Click in Lightning Experience

The new My team’s opportunities list view is based on role hierarchy. Sales managers can use it to easily see all the opportunities owned by their direct and indirect reports without creating a list view.

Price Book Entries: Track Changes with Field History Tracking and Audit Trails

Price book entries now support field audit trails and field history tracking, so now you can easily track changes to price book entry fields.

Develop

Lightning Web Components: Open Source

To develop off-platform Lightning web components, see https://lwc.dev/

Add Lightning Web Components as Custom Tabs
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <targets>
        <target>lightning__Tab</target>
    </targets>
</LightningComponentBundle>
Share CSS Style Rules

To share CSS style rules, create a component that contains only a CSS file. Import the style rules from that CSS file into the CSS files of other Lightning web components.

DOM API Changes

Attention! In Winter ’20, code can’t use document or document.body to access the shadow tree of a Lightning web component. For example, code in a test can’t call document.querySelector() to select nodes in a Lightning web component’s shadow tree.

To fix see the guide: https://releasenotes.docs.salesforce.com/en-us/winter20/release-notes/rn_lwc_dom_api.htm

Aura Components in the ui Namespace Are Being Retired

The ui components are scheduled for retirement in all Salesforce orgs in Summer ’21. Use similar components in the lightningnamespace instead. Retiring our legacy components enables us to focus on components that match the latest web standards in performance, accessibility, user experience, and internationalization. See the list of replacement: https://releasenotes.docs.salesforce.com/en-us/winter20/release-notes/rn_aura_ui_deprecate.htm

Callouts Are Excluded from Long-Running Request Limit

Every org has a limit on the number of concurrent long-running Apex requests. This limit counts all requests that run for more than 5 seconds (total execution time). However, HTTP callout processing time is no longer included when calculating the 5-second limit. We pause the timer for the callout and resume it when the callout completes.

Changed LWC

See full list: https://releasenotes.docs.salesforce.com/en-us/winter20/release-notes/rn_lwc_components.htm

New Apex Classes

Formula Class in the System NamespaceThe new System.Formula class contains the recalculateFormulas method that updates (recalculates) all formula fields on the input sObjects.

At the moment that’s all.

See you in Spring ’20!

Salesforce Summer ’19 Platform Release: quick highlights

Our week’s trailblazer is Claudio Marzorati, who will be listing some of his favorite Summer’19 Salesforce platform release.

Claudio is a Senior Salesforce Developer @ Sintegra s.r.l. (Milan). He worked with different retails that allowed him to increase his technical background on several aspects.
From analysis, to development, to the direct relationship with the customer, nothing is left to chance.
Other passions are running and travels!


Summer 19′ hass finally arrived and in our org all changes are going to be applied.

Here I summarize some of the most important features that can impact your org.

Lightning URL parameters have been namespaced

Finally they have been release the funtiality that forces URL parameters to be namespaced.
So if you add ?foo=bar to the URL, it will get auto-stripped.
But if you add ?c__foo=bar to the URL, it will persist.

Keep Record Context When Switching from Salesforce Classic to Lightning Experience

When you switch from Salesforce Classic to Lightning Experience, you land on the same page in Lightning Experience, if it exists. If the same page doesn’t exist in Lightning Experience, you are redirected to your default landing page, which is determined by the org default or your customizations.

Choose from Two Record View Options

Now you have two record page view default options. Choose between the current view—now called Grouped view—and the new Full view. In Setup, enter Record Page Settings in the Quick Find box, and select Record Page Settings.


Full view (1) displays all details and related lists on the same page. Grouped view (2), the original Lightning Experience record view, focuses on specifics by grouping information across tabs and columns.

Search Picklist Fields in List Views

You don’t have to manually pick through your list views to find the picklist values you’re looking for. List view search now includes picklists in your query results. Dependent picklists and picklists with translated values aren’t searchable.

Continuation

Finally we can use the Continuation pattern from an Aura component or a Lightning web component. Continuation class
in Apex are used to make a long-running request to an external web service Process the response in a callback method. An asynchronous callout made with a continuation doesn’t count toward the Apex limit of 10 synchronous requests that last longer than five seconds. Therefore, you can make more long-running callouts and integrate your component with a complex back-end API. In Lightning-Web-Component now we can use
@salesforce/apexContinuation in order to provides access to an Apex method that use the Continuation.

Aura Components

There a lot of improvements expecially in LWC and below I report the most used in my develop.

lightning:recordEditForm

density option

Sets the arrangement style of fields and labels in the form. Accepted values are compact, comfy, and auto. The default is auto, which lets the component dynamically set the density according to the user’s Display Density setting and the width of the form.

onerror handler event changed

You can now return the error details when a required field is missing using event.getParam("output").fieldErrors. To display the error message automatically on the form, include lightning:messages immediately before or after the lightning:inputField components.  

lightning:inputField

reset function added

Resets the form fields to their initial values.

There are few deprecated component in force and ui: force:recordEdit, force:recordView, ui:input (all types), ui:button, ui:menu (all types), ui:output (all types), ui:spinner.

Web Component

Salesforce is spending a lot of time and resources in improving this new components. There are a lot of new functionalities added and below I report the most significant.

lightning-input

autocomplete function added

Controls autofilling of the field. This attribute is supported for email, search, tel, text, and url input types.

date-style (or time-style) function added

The display style of the date when type='date/time' or type='datetime'. Valid values are short, medium, and long. The default value is medium. The format of each style is specific to the locale. This attribute has no effect on mobile devices. 

lightning-input-field

reset function added

Resets the form fields to their initial values.

lightning-record-edit-form

density option

Sets the arrangement style of fields and labels in the form. Accepted values are compact, comfy, and auto. The default is auto, which lets the component dynamically set the density according to the user’s Display Density setting and the width of the form.

onerror handler event changed

You can now return the error details when a required field is missing using event.getParam("output").fieldErrors. To display the error message automatically on the form, include lightning:messages immediately before or after the lightning:inputField components.  

Minor UX Improvement

They have changed the UX provided. Some example for recent records and for the related list are below reported.

More comprehensive layout for Recent Records
Related Lists have more impact for users

More details can be found at
https://releasenotes.docs.salesforce.com/en-us/summer19/release-notes/salesforce_release_notes.htm.

[Salesforce / API] Bulk API 2.0 quick & dirty!

I introduce you our week’s trailblazer Claudio Marzorati.

Claudio is a Salesforce Developer @ PwC Italy (Milan) with 2 years of experience. He worked with different retails that allowed him to increase his technical background on several aspects.
From analysis, to development, to the direct relationship with the customer, nothing is left to chance.
Other passions are running and travels!

Enjoy his quick & dirty post about Bulk API 2.0.


Since the introduction in the Winter ’18 (API version 41.0), managing bulk transactions became easier (official documentation here).

The flow to manage a job became quicker with less steps to process the set of records. To better understand the main features, here is an overview of the process for creating and managing a job with Bulk API 1.0.

If you work with few records, you won’t have many problems, but with large amount of data…it’s another story!

Working with API 1.0 means that you will follow many steps to achieve the goal.

At first you have to authenticate yourself against Salesforce to obtain a valid session ID, e.g. using SOAP APIs.

Next important thing you have to consider is that you need to pre-process your data to create N separated batches, because in this version you haven’t an automatic process that analyze and slice the data.

Here are the main manual operations:

  1. Divide the data not to reach the batch size limit
  2. In each batch there can’t be concurrent operations that can lock a record
  3. Need to customize the header with compression or PK Chunking

You can spend a lot of time on step 2, but unlikely in Bulk API 1.0, in Bulk API 2.0 all you have to do is to upload your data and Salesforce worries about all pre-processing.

With Bulk API 2.0 you have to specify few simple steps and your job will be processed.

Below I report a simple schema with all the API 2.0 available. (The dashed component are optional and you can skip them)

I’ll provide you a quick example to start learning to use Bulk API 2.0.

We always start with a:

URL:
    https://{instance}.salesforce.com/services/oauth2/token?grant_type=password&client_id={client_id}
    &client_secret={client_secret}&username={user}&password={password+SecurityToken}

METHOD:   
    POST

To get more insights of how to get all the pieces of the call, refer to this blog post (search for OAuth Password Flow).

The response gives you the access_token (known as session id) that you need in all subsequent Bulk API 2.0 calls and the instance_url to call against:

{
  "access_token":"00D6E0000000xxx!ARIAQL7GNMpk...",
  "instance_url": "https://cs85.salesforce.com",
  "id": "https://test.salesforce.com/id/00D6E0000000XXXXXX/0056E000002LXXXXXXX",
  "token_type": "Bearer",
  "issued_at": "1520445583894",
  "signature": "rHVTsVcvZkrogMNNzxH7GpfKFlkGIHGLySS/jsVhhWc=
}

Let’s create a Job:

URL:   
   https://{instance}.salesforce.com/services/data/41.0/jobs/ingest

METHOD:   
   POST

HEADERS:   
   Content-Type: text/csv
   Authorization:Bearer {session_id}

BODY
{

  "columnDelimiter" : "COMMA",  Optional
  "externalIdFieldName": "",  Required for upsert operations
  "lineEnding": "CRLF",  Optional
  "operation": "upsert",  Required
  "object": "Account",  Required
  "contentType": "csv"     Optional
}

The response gives you back the Salesforce ID of the new batch and other configurations details:

{
   "id": "7500Y000009MxxXQAS",
   ...
}

Now put your data inside the job, paying attention to the schema/format previously defined (separator and line ending):

URL:   
   https://{instance}.salesforce.com/services/data/41.0/jobs/ingest/{jobID}/batches

METHOD:  
   PUT

HEADERS:   
   Content-Type: text/csv
   Authorization:Bearer {session_id}

BODY
   your csv input

The response has status code 201 Created if the data is compliant with the specified job configuration.

When your data is fully uploaded you can finally close your job:

URL:   
   https://{instance}.salesforce.com/services/data/41.0/jobs/ingest/{jobID}

METHOD:  
   PATCH

HEADERS:   
   Content-Type: text/csv
   Authorization:Bearer {session_id}

BODY
   {
      "state" : "UploadComplete"
   }

From now on your job will be processed, depending on your org’s queue.

If you want to check succesfull, failed or unprocessed records you can use this call:

URL:  
    https://{instance}.salesforce.com/services/async/41.0/job/{job_id}/{successfulResults|failedResults|unprocessedRecords}/

METHOD:  
   GET

HEADERS:   
   Authorization:Bearer {session_id}

The response will show the record of the csv in the requested state.

As shown Bulk API 2.0 highly simplifies the creation of bulk jobs…now it’s your turn to experiment these new APIs!

Powered by WordPress & Theme by Anders Norén