Posts

Salesforce Fact #978 | Hide action button in screen flow

Image
We can hide the screen flow action button based on component visibility. Suppose we need to make sure the action button once clicked it should get hidden. It should be visible again once the user comes back from any previous or next screen. For this, we can define a boolean variable in the subflow and also make use of the InProgress attribute of the screen action. These two values can be used in component visibility to show/hide the button. At the start the boolean variable is null and the inProgress attribute is null if the action button has been called once and we come back to the screen from any previous/next screen. Attached is the screenshot.

Salesforce Fact #977 | Formatted label in screen flow input

Image
In some scenarios, we need to show the screen input element labels as formatted. For example, the label of a text input would be bold. For this, we can create a text template and put the formatted text and then refer this text template resource in the input label. Note: The extra <p> tags needs to be removed else the help text and required icons would get distorted. Attached are the screenshots.

Salesforce Fact #976 | External service issue in apex

While referencing the external services in apex, we might encounter error like: Dependent class is invalid and needs recompilation: Class ExternalService.MyCallout : Unexpected token '2'. This is a known issue. The workaround is to replace '2XX' with '200' in the JSON of external service. Reference:  https://help.salesforce.com/s/issue?id=a028c00000uW9g4

Salesforce Fact #975 | Field history tracking issue with system context

There's a loophole with the field history tracking when the automation is executed in system context. If the user doesn't have the object access/field access and the automation executes in system context without sharing mode, then the record gets created and the audit fields are stamped correctly but the field history related list stays blank. Here's the relevant Idea link:  https://ideas.salesforce.com/s/idea/a0BHp000019OmswMAC/enable-field-history-for-system-mode-dmls-regardless-of-object-permissions Reference:  https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000mjpO60AI

Salesforce Fact #974 | External credential not configured issue fix

After deploying the external credential and external service registrations to the higher orgs, you might encounter the error from flow while invoking the callout: 'The external credential isn't fully configured. Try reconnecting to the external system or contact your Salesforce admin'. To fix this issue, Go to the external credential -> Under Principals section, check the authentication status -> if it is not configured, click dropdown -> edit -> populate the correct Client Id & Client Secret -> Save. This will update the authentication status to Configured.

Salesforce Fact #973 | Date/Time calculation in screen flow

Image
Suppose we have an input Date & Time element in the screen flow and after populating the input, we would like to perform some calculation by adding/subtracting hours and minutes. We can implement the logic using couple of screen elements and formula resource. Attached are the screenshots.

Salesforce Fact #972 | Query row count in get related records(beta)

Image
While using the Get Related Records(Beta) feature in flow, the total query row count is based on the parent record only. In this example, An account has 2 related contacts and 3 related opportunities. In apex, the total query rows count is 6 whereas in autolaunched flow, it is returned as 1. Attached are the screenshots.