You need to sign in to do that
Don't have an account?
Rajasekhar RS
need triggers
hi everyone
Invalid identifier ' '. Apex identifiers must start with an ASCII letter (a-z or A-Z) followed by any number of ASCII letters (a-z or A-Z), digits (0 - 9), '$', '_'.
thankyou
Invalid identifier ' '. Apex identifiers must start with an ASCII letter (a-z or A-Z) followed by any number of ASCII letters (a-z or A-Z), digits (0 - 9), '$', '_'.
thankyou
This issue will be generally due to some invisible characters . It may be due to copy and paste issues. You may need to rewrite the entire trigger again.
Can you share the Trigger code so can check the issue .
Thanks
List<User> allUser = [SELECT Id, Email, Profile.Name FROM User WHERE Profile.Name='E-Zone Customer'];
List<String> emailAddresses = new List<String>();
for (User u : allUser) {
emailAddresses.add(u.Email);
}
List<Product_Offers__c> newofferList= [SELECT Id, Name, Discount__r.Name, Product__r.Name FROM Product_Offers__c where Id=:Trigger.new[0].Id];
Product_Offers__c newOffer = newofferList[0];
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setToAddresses(emailAddresses);
mail.setSubject('New Offer: ' + newOffer.Name);
mail.setPlainTextBody('A new Offer has been created: ' + newOffer.Name + '. Offer: ' + newOffer.Discount__r.Name + '. Product: ' + newOffer.Product__r.Name);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
I tried saving the same code as below and did not face any error. Are you creating this as Triger on the same object.
Can you try replacing the below code in the same trigger.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,