function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

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 : {
        caseList.add(new Case(AccountId = acc.Id, Status = 'New'));
    insert caseList;
Best Answer chosen by keshava65
Grazitti TeamGrazitti Team
Hi kishore,

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 :-)

Grazitti Team