Validation Rules

Salesforce Validation Rules

GPT writes validation rules! You can give GPT a request for a validation rule and it will do it’s best to translate that into a functioning rule that you can paste into your Salesforce org. In the example below, our business requirement is to make sure users are required to complete a custom Closed Lost Reason field when closing an opportunity. Watch how AI provides a perfect response!

Using AI Force

Using ChatGPT

Our Request:

Write a Salesforce Validation Rule for: Closed_Lost_Reason__c is required if Stagename is set to "Closed Lost".

AI’s Response:

It doesn’t happen often, but this is a perfect validation rule with no errors in logic nor syntax!

Learning to get good validation rules out of GPT is a challenge. The way you submit your requests to GPT determines the outcome. GPT is really good at the syntax, so no mater how good or bad your request was, most of the time you’ll get good syntax in your response so you can focus on the actual logic it returned instead of whether or not your missing a comma or parenthesis!