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
Edwards71Edwards71 

Prevent new task if parent record flagged as approved

hi - I have a custom object with a checkbox approved__c.  If this checkbox is true I would like a validation rule that would prevent a new task being created on it. Any ideas?

 

thanks in advance!

Edwards71Edwards71
I've tried this but I get a suntax error that a 'Record name' is expected


vlookup( $ObjectType.Term__c.Fields.Approved__c , $ObjectType.Term__c.Fields.Id ,WhatID )=true
AroraAnupAroraAnup

I don't think a validation rule will work here. You would probably need to create a trigger if you want no Tasks to be created if the checkbox is Checked.

 

Hope this helps!

Rahul_sgRahul_sg
Using trigger you can definitely do this, but try this first if it works:

vlookup( $ObjectType.Term__c.Fields.Approved__c , $ObjectType.Term__c.Fields.name ,What.Name)=true

as The field_on_lookup_object must be the Record Name field on a custom object.