You need to sign in to do that
Don't have an account?
vikmac
APEX Trigger - Script Exception
Hello
I have written the following trigger for my custom object -
trigger field_update on PM_Requests__c (after insert, after update, after delete) { for (PM_Requests__c pm : Trigger.new) { Product2 p = [Select p.name from Product2 p where p.name= :pm.Products__c]; pm.Product_Email_DL__c=p.Email_DL_for_PMs__c; } }
It does not seems to be working properly and produces an exception (whenever I add a new record for that object) as -
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger field_update caused an unexpected exception, contact your administrator: field_update: execution of AfterInsert caused by: System.QueryException: List has no rows for assignment to SObject: Trigger.field_update: line 3, column 22
Review all error messages below to correct your data.
Apex trigger field_update caused an unexpected exception, contact your administrator: field_update: execution of AfterInsert caused by: System.QueryException: List has no rows for assignment to SObject: Trigger.field_update: line 3, column 22
Please try to help me on this.
Thanks in advance...
Hey, for this exception, I am getting an email every time it occurs...
Can you tell me how do I stop receiving emails for the same?
Thanks