Flow and Validation Rules
Salesforce Flow and Validation Rules are essential tools that every Salesforce admin frequently uses. In certain scenarios, you may need to create Flows or Validation Rules specifically for the Salesforce mobile app or exclude them from it. Additionally, you might want to implement different logic depending on whether the user is on the mobile app or desktop. To achieve this, you can configure a flow that behaves differently based on the user’s device. However, keep in mind that this approach only works in screen flows, as it involves a local action, and local actions are supported only within screen flows. It’s also important to note that this method cannot be applied to Validation Rules, as actions are not compatible with them. Using the User Global Variable to Detect Mobile App Usage Global variables in Salesforce provide general information about the current user and your organization. One particularly useful global variable, $User, stores data like the user’s ID, email, Profile ID, and more. A lesser-known but valuable property, $User.UIThemeDisplayed, identifies the Salesforce interface the user sees. This variable enables you to design Flows and Validation Rules specifically for the Salesforce mobile app or desktop experience. The $User.UIThemeDisplayed variable can be used to detect the CSS theme applied to Salesforce web pages for a user. Below are the possible values: To detect if a user is on the Salesforce mobile app, check if $User.UIThemeDisplayed equals ‘Theme4t’. This allows you to apply different logic depending on the theme being used, such as differentiating between Salesforce Classic and Lightning Experience. Examples By leveraging the $User.UIThemeDisplayed global variable, you can customize the behavior of your flows and validation rules, ensuring a tailored user experience on the Salesforce mobile app or desktop. Like Related Posts Salesforce OEM AppExchange Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more The Salesforce Story In Marc Benioff’s own words How did salesforce.com grow from a start up in a rented apartment into the world’s Read more Salesforce Jigsaw Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more Health Cloud Brings Healthcare Transformation Following swiftly after last week’s successful launch of Financial Services Cloud, Salesforce has announced the second installment in its series Read more