You need to sign in to do that
Don't have an account?

UserRecordAccess object is not working for running user
Hi Guys,
I have a custom button, in that button i am querying the record from UserRecordAccess object using AJAX script to know the current user is having the edit access or not on the particular record.
If user is having the edit access then only i am doing some operations. It is working fine as a system admin. but when the end user click on the button it is showing error Invalid Type sobject.
It is not working for the running users. please suggest on this. Other than the UserRecordAccess object, is there any other way to know the record access.
Thanks,
Krish
I have a custom button, in that button i am querying the record from UserRecordAccess object using AJAX script to know the current user is having the edit access or not on the particular record.
If user is having the edit access then only i am doing some operations. It is working fine as a system admin. but when the end user click on the button it is showing error Invalid Type sobject.
It is not working for the running users. please suggest on this. Other than the UserRecordAccess object, is there any other way to know the record access.
Thanks,
Krish
I have tried upto 33.0 API version but it is not working and the API enabled option is checked for that running user as well. It is working fine for system admin. And while page is refreshing if we click the button immediately then it is working fine but after page load it is not working.
Can we run the ajax script with a specific user like system.runas()
Thanks,
Krish
I have created a method and executed from the button then it is working fine.
Thanks,
Krish
i m facing the same problem. i didnt use any azax. In my case a method is called from a lightning button. When i ran the query as a sysAmdnin i get a specfic user has read access false but when i ran the same code after login with that user it shows it has read access. So if you can share your solution it will help.
thanks,
Sam