Salesforce Fact #508 | Ends with in validation rule

We have BEGINS() function in validation rule to check whether a String starts with a particular text. But there is no function to check whether a String ends with a particular text. We can implement the same using a bit of tweak in the logic.

Suppose, we have a use case where the Account description does not end with the word 'Test'. We can use the RIGHT() function to implement this logic. Also to make the text configurable, we can use custom labels and also in order to check case insensitivity we can use UPPER/LOWER functions.

Attached are the screenshots.






Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow