You need to sign in to do that
Don't have an account?
keshava65
I am Getting error Variable does not exist: Id
Variable does not exist: Id
trigger InsertCase on Account (after insert) {
list <case> caseList = new list <case>();
for(Account acc : trigger.new) {
caseList.add(new Case(AccountId = acc.Id, Status = 'New'));
}
insert caseList;
}
trigger InsertCase on Account (after insert) {
list <case> caseList = new list <case>();
for(Account acc : trigger.new) {
caseList.add(new Case(AccountId = acc.Id, Status = 'New'));
}
insert caseList;
}
There is no problem in your code I inserted your code in my developer org and it saved successfully.
I guess there is some other problem, because Id is a standard field.
And don't forget to mark this answer as best, if answer this helps you :-)
--
Regards,
Grazitti Team
Web: www.grazitti.com