You need to sign in to do that
Don't have an account?

Apex Trigger To Delete or Not Insert A Record
Hello:
I have to custom objects - Fiber_Qualified_Address__c and IPTV_Qualified_Address__c. What I would like to do is the following:
Build a trigger where when I create a new record on IPTV_Qualified_Address__c, it checks to ensure that the address does not exist on Fiber_Qualified_Address__c.
Both objects contain the fields Street_Address__c, Loc__c, and Zip_Code__c so a concatenation of those fields would be the string to look for.
If there is a match after insert of ITPV_Qualified_Address__c, I would like the record deleted. I will be inserting upwards of 2,000 records at a time into IPTV_Qualified_Address__c using the data loader so I would need it bulkified.
Can anyone please help?
Thanks!
Matt
try these trrigger :
If you want to delete the record
If you want to stop insertion
try this
I hope it helps you