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
blake.tanonblake.tanon 

Validation between tasks and contacts

Greetings All,

 

I'm working on a process to require our sales reps to ask for a referral every 30 days from each contact.  I'm going to post my thoughts on how to best do this and would like any thoughts.

 

Contact Field: Last Referral Date (Date)

Task Field: Status (Picklist Standard) Not Started - Completed

     Status controls Outcome, is Completed then opens values.

Task Field: Outcome (Picklist) Success - Failure

     This field will control Referral, if Success then picklist opens.

Task Field: Referral (Picklist) Yes - No 

 

Now, I need a write a trigger that will populate Last Referral Date on contact when a task is saved with Status=Completed, Outcome=Success & Referral=(Yes or No).

 

What I'm struggling with is how to validate the task and also display on the task that a referral is required to save it.  I can't write a trigger to populate a field on task because we have recurring tasks and tasks scheduled out over time that won't be updated correctly.  My thought is to have a VF page saying 'Ask for Referral' or something ot that sort where the logic would pull from the Last Referral Date on teh related contact.  How would I go about doing that and then validating it as well?