You need to sign in to do that
Don't have an account?
Apex-Trigger
Apex class error ::Type is not visible: account
Hi ,
I got a error , Account type is not visible . I checked sharing settings it is fine , I am working as sys admin , My apex code is correct , I dont know where i gone wrong , Can any one help me ?..
Thanks ,
Jana
this usually happens when you set the class members as private and try to access them out of the class. try making your variable as public and see if it works for you!
baskaran
All Answers
this usually happens when you set the class members as private and try to access them out of the class. try making your variable as public and see if it works for you!
baskaran
Could you post the trigger code. It will help in understanding the cause of the issue.
Thanks a lot....My apex class is private ...so that created a problem ...
can you paste the code snip which is hrowing this error?
Code is Not a problem , Apex Trigger :
trigger AccountDelete on Account (before delete,before insert,before update,after delete, after insert,after update) {
for(account a : trigger.old)
{
if(a.Name!='todelete')
{
a.addError('You Dont have access to delete this account');
}
}
}
Apex Class:
private class account {
static testMethod void myUnitTest() {
// TO DO: implement unit test
}
}....Hence apex class name is Account ....Trigger refers to account , it means account class ,hence the class is private can not be accessed outside ...so it throws an error .
...Error in Trigger :Type is not visible: account .... I solved it by changing account class name as accountcheck ....
Good to know, I experienced the same type of error first time, where I had created an Apex class by Name "Test" , I remember It took me whole of the day to identify this error :)