+ Start a Discussion
netTrekker_ADnetTrekker_AD 

Task VR: Can you require the Related To field?

Hello,

 

I thought this was simple, but Im running into an issue I need someone to set me straight on. I want to be able to require the Related To (WhatId) field of a task, but because when the Name field is set to Lead, the Related To field grays out and cannot be completed. 

 

My problem is, when I made a simple rule such as:

 

WhatId = ""

 

it still throws the error even when the task is logged with a Lead (even though the WhatId field cannot be completed). 

 

Is there a way to write the rule where "if Name is a Contact, then Related To is required"?

 

Best Answer chosen by Admin (Salesforce Developers) 
SteveMo__cSteveMo__c

Try using something like this.

 

 

AND(NOT(LEFT(WhoId,3) = "00Q"),LEN(WhatId) < 1)

 The RecordId for a Lead always begins with "00Q"

 

 

Message Edited by Stevemo on 02-05-2010 01:28 PM

All Answers

SteveMo__cSteveMo__c

Try using a LEN function like

 

 

LEN(WhatID) < 1

 

 

 

 

netTrekker_ADnetTrekker_AD

I tried that as well and I still get an error when I attempt to log a call with a Lead. The Related To field is grayed out, yet it is still requiring it.

 

I need to be able to allow a task with a Lead to be saved (with no Related To) while a task with a Contact can only be saved if the Related To field is complete.

SteveMo__cSteveMo__c

Try using something like this.

 

 

AND(NOT(LEFT(WhoId,3) = "00Q"),LEN(WhatId) < 1)

 The RecordId for a Lead always begins with "00Q"

 

 

Message Edited by Stevemo on 02-05-2010 01:28 PM
This was selected as the best answer