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
AlsoDougAlsoDoug 

Trigger To Block Creation Without Error

I have read the cookbook and see that I can use a trigger to block the creation of a record by throwing an error.

 

Is there a way to do it without throwing the error?

 

I need on creation of a task to check certain values and if they sync up I have to create a different object and not save (or delete after insert which doesn't seem possible) the original task.

 

Thanks

Doug

 

ShamSham

You can try using @future method where in you can pass the TaskId

 

and in the future method you can delete the original Task.

AlsoDougAlsoDoug

Hrm. Seems easy enough to test.

 

Thanks, will let you know if it works.