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
Apex-TriggerApex-Trigger 

Apex-Trigger-CompileError-'Type is not visible: account at line 2 column 7'

trigger AccountDelete on Account (before delete) {

for(account a: trigger.old)
{
if(a.Name!='todelete')
{
a.addError('You Dont have access to delete this account');
}
}

}

I dont know what is wrong in that .What it means can any one help ...?

Navatar_DbSupNavatar_DbSup

Hi,

 

I have tried your code at my end .its working fine.

If you have any issue. Let me know with error message or with screen shot.

Apex-TriggerApex-Trigger

Hi jain ,

 

     Is it working fine for you , can you tell me what changes have you made , I tried a lot but ,i cant figure it out .

trigger AccountDelete on Account (before delete) {

for(account a: trigger.old)
{
if(a.Name!='todelete')
{
a.addError('You Dont have access to delete this account');
}
}

}

...What changes you made in this code .

 

Thanks ,

 

Janarthanan.M


Apex-TriggerApex-Trigger

Hi jain ,

 

  I have attached a screen shot of what i got ..

 

Thanks ,

 

Janarthan.M

Navatar_DbSupNavatar_DbSup

Hi,

 

 Are you using admin credential for this or using any user credential. So may be that user don’t have right of that object or field. Hence please check you OWD setting and field level security.

Apex-TriggerApex-Trigger

Hi ,

 

 I am using as sys admin . sys admin has every rights , moreover this is sobject , I dont know what is wrong .You said that it is working fine for you , can you tell me how you done this thing .

 

Thanks ,

 

Jana.M