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
Local EdgeLocal Edge 

Validation Rule help for Task Subject Field

I had originally wanted to change the Subject Field in the Task window to a drop down menu with some specific items to select from.

 

Per SF support this is a hard coded field and cannot have the type changed.

 

Basically what I would like to do is have a validation rule in place that restricts what can be typed/entered into the task field…i.e. if they do not enter one of the items from the picklist the record cannot be saved.

 

The picklist items currently in place are:

Call

Drop In

Meeting

Email

Proposal Requested

Proposal Received.

 

Is this something anyone can help with?

MarkSilberMarkSilber

You can write validation rules for Tasks just like any other object. Here's one way to accomplish what you need:

1. Create a new Activity custom formula text field, "Subject Check". This field should not be on any page layouts.

 

CASE(Subject, "Call", "Valid", "Drop In", "Valid", "Meeting", "Valid", "Email", "Valid", "Proposal Requested", "Valid", "Proposal Received", "Valid", "Invalid")

 

2. Create a new Task validation rule:

    Error Condition Formula: Subject_Check__c = "Invalid"

    Error Message: Subject must be one of the following values: Call, Drop In, Meeting, Email, Proposal Requested, Proposal Received.

    Error Location: Subject

 

The validation rule is case sensitive -- that is, users will need to enter "Call" versus "call" or it will not let them save the Task.

 

 

 

 

 

Local EdgeLocal Edge
This worked great...Thanks so much for your help!
Local EdgeLocal Edge

New issue...Now that this rule is active we are unable to convert leads to accounts.

 

When an attempt is made the error warning for task subject pops up even though a proper subject field is selected.

 

I had to take the validation rule offline to convert.

MarkSilberMarkSilber
I just tested converting a Lead to an Account/Contact/Opportunity with an associated task using "Call" as the subject and didn't get an error in the developer org where I created it.

Is there anything else that may be causing this? Are you sure the Subject field is correctly filled in on the Convert screen?
Vamsi PenugurthiVamsi Penugurthi
I have similar problem
https://developer.salesforce.com/forums/?id=9062I000000IYGHQA4