You need to sign in to do that
Don't have an account?
Deepak Pansari
System.SObjectException: Field Lead.LastViewedDate is inaccessible [ LastViewedDate ]
Hi All,
I have a code which are getting all the fields name and their properties like api name, label , data type.
Now for deployed the code I am getting this exception :
System.SObjectException: Field Lead.LastViewedDate is inaccessible in this context.
It seems that there is a field "LastViewedDate" , I have checked all fields but I am not able to find this.
Please let me know if any one have any idea.
Regards,
Deepak
Hi ,
I have checked again and there is no such field in any org.
Is there any way to find out what are the fields are present for Lead object.
- Deepak
Hi Deepak,
You can use the force.com IDE (Eclipse) for Schema browsing. You can see all fields there or you can use Dynamic Apex also.
For Dynamic Apex code snippets refer below article:
http://shivasoft.in/blog/salesforce/very-useful-tips-and-tricks-of-the-apex-salesforce-interview-questions-part-4/
Hey Jitendra,
Thx I used the code mentined in the site , But still unable to find field "LastViewedDate".
Any other thoughts?
- Deepak
Hi Deepak,
If you are not able to see the field then it means it is not present. You will need to create that field.
HI,
I have checked all possibe way to find that field in both org , but not able to find it.
If you see my subject line it seems "LastViewedDate" , its standard field.
- Deepak
Change the version of the class to 28.0.
LastViewedDate is accessible in summer 13.
You can refer here : https://na14.salesforce.com/help/doc/en/salesforce_summer13_release_notes.pdf
(search for LastViewedDate)
"Field Product2.LastViewedDate is inaccessible in this context".
When i refreshed the page by entering the page again (or entering the url again), and not by reloading, it solved.
This field is not referenced anywhere in my code.