+ Start a Discussion
Sandesh D GanjareSandesh D Ganjare 

How to stop inserting of record?

If u have taken leave on certain date and then again applied on the same date then your application will not be submitted.
how I will do that one.
please Help.
Shyama B SShyama B S
Hi Sandesh,

You can check the below link where a similar question was asked.

To know more about triggers and Trigger.Error, the below link can give you an intro:

Amit Chaudhary 8Amit Chaudhary 8
Please try below code. I hope that will help u
trigger ContactTrigger on Contact(before insert)
for(Contact cont : trigger.new)
	if(cont.lastName == 'Test')
      cont.addError('Please enter valid LastName');
Please let us know if this will help you

Amit Chaudhary