You need to sign in to do that
Don't have an account?
Siddharth Birari.ax1164
Update Account Record Through Customer Portal in Test Code
Hi,
In one of my production environment, I am still using Customer Portal (Not Community).
Here, I have one visualforce page on customer portal on which I update one specific Account record.
This works perfectly fine when I log in to the customer portal with a user having profile 'Custom Overage High Volume Customer Portal'. A custom profile with access rights to udpate the Account record.
Now, I need to replicate the same use case in Test code. Hence I created first an Account reocrd and a User record with above given profile.
When I run my test code under the context of the created user, and perform update operation on Account record, it gives me an exception.
I don't have any clue why the test code is not working as expected whereas the actual execution is as desired.
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY
In one of my production environment, I am still using Customer Portal (Not Community).
Here, I have one visualforce page on customer portal on which I update one specific Account record.
This works perfectly fine when I log in to the customer portal with a user having profile 'Custom Overage High Volume Customer Portal'. A custom profile with access rights to udpate the Account record.
Now, I need to replicate the same use case in Test code. Hence I created first an Account reocrd and a User record with above given profile.
When I run my test code under the context of the created user, and perform update operation on Account record, it gives me an exception.
I don't have any clue why the test code is not working as expected whereas the actual execution is as desired.
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY
Try to insert / update Account within the System.runAs() mode.
In this mode pass the current user data, not a created test user data Due to the Sharing Accessblity.
For Reference : http://www.tgerm.com/2011/03/trigger-insufficient-access-cross.html