Salesforce Certified Platform App Builder free question 5 / 10 · Domain 3: Business Logic and Process Automation
Account has two record types, Corporation and Sole Proprietor. The admin wants the Corporate Number text field to be required only for the Corporation record type, and allowed to be blank for Sole Proprietor. Which method matches the Help writing tips?
- Create two validation rules, assign one of them to the Corporation record type only, and let it be evaluated for corporations
- Use a validation rule formula with RecordType.Id that raises the error when the record type is Corporation and Corporate Number is blank
- Make Corporate Number required on the Corporation page layout and not required on the Sole Proprietor layout
- Add a lookup filter to Corporate Number so that input is requested when the record type is Corporation
Show the answer and explanation
Answer: B
Why this is correct
"Tips for Writing Validation Rules" recommends using the RecordType.Id merge field in the formula when you want a different validation rule to apply per record type. Making the record type a condition in the expression lets one rule express "raise the error only for Corporation when the corporate number is blank".
Why the other options are wrong
"Make Corporate Number required on the Corporation page layout and not required on the Sole Proprietor layout" … The tip is to use RecordType.Id in the formula to validate different input per record type. A validation rule applies even when the field is not on the layout or in an API call, but a required setting on a layout does not apply to paths such as the API.
"Add a lookup filter to Corporate Number so that input is requested when the record type is Corporation" … A lookup filter narrows the candidates shown in a lookup search window. It does not make a text field required.
"Create two validation rules, assign one of them to the Corporation record type only, and let it be evaluated for corporations" … Help says to use the RecordType.Id merge field in the formula when you want to validate different input per record type. It does not describe assigning a rule itself to a record type.
Key point
When you build the formula, picking fields with Insert Field lets you check they are usable on the object, and a field that does not exist gives an error. When referencing a field of a related object, also check that the related object is deployed.