function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
HNT_NeoHNT_Neo 

Record Type and Picklist Requirement

Hello, 

I have 14 record types that when a picklist from the Status is selected, the text field comments__c, but be required when saving a record. 

Can someone help me in figuring out the Validation Rule syntax for this? 

Here are my API details: 

Record Type IDs: 

012d0000000XHqhAAG
012d0000000hPmqAAE
012d0000000hPmvAAE
012d0000000XMJNAA4
012d0000000XNaIAAW
012d0000000XMJXAA4
012d0000000XMK1AAO
012d0000000XMKGAA4
012d0000000XNZPAA4
012d0000000XNZKAA4
012d0000000XNZFAA4
012d0000000XNZAAA4
012d0000000XNZUAA4
012d00000015DKuAAM

Text field API Name: 
Comments__c

Stauts API Name: 
Status

 
Best Answer chosen by HNT_Neo
Ajinkya1225Ajinkya1225
Hi Neo,

Here is the validation rule:
AND( $RecordType.Name = "Record_Type_Name", ISBLANK( Comments__c) )

Note: As a best practice, always use Record Type Name. Ids may change between environments.


Please take a moment to upvote and mark this answer as solved, if it helped you.
Cheers!
Ajinkya Deshmukh

All Answers

Ajinkya1225Ajinkya1225
Hi Neo,

Here is the validation rule:
AND( $RecordType.Name = "Record_Type_Name", ISBLANK( Comments__c) )

Note: As a best practice, always use Record Type Name. Ids may change between environments.


Please take a moment to upvote and mark this answer as solved, if it helped you.
Cheers!
Ajinkya Deshmukh
This was selected as the best answer
HNT_NeoHNT_Neo
thank you Ajinkya, what is the syntax to place multiple record type names into the VR? 
HNT_NeoHNT_Neo
So I have a Record Type Name, a picklist value from the status and a text field to be completed when the following is selected:

REcord Type Name = Choice 1 or Choice 2 or Choice 3
Picklist Name: Status
Picklist selection: Waiting
Text Field Name: Description

The below syntax isn't working correctly: 
 
AND( 
$RecordType.Name = "Choice 1","Choice 2",Choice 3"), 
ISPICKLIST(Status, "Waiting"),
ISBLANK( Description) 
)

 
HNT_NeoHNT_Neo
I tried this syntax and it worked
AND 
(ISPICKVAL(Status,"Waiting"), 
ISBLANK(Description) 
)

 
Ajinkya1225Ajinkya1225
Hi Neo,

Great that you figured it out!

Cheers :)