You need to sign in to do that
Don't have an account?
One Class can update an object the other one cant (already checked CRUD, FLS, page + apex security)
Hey Guys,
I have two classes, one updates 2 fields on a record and the other class updates a different field on the record. Sounds simple......
The first class is working perfectly and is encrypting some user entered data perfectly and storing it against the record. The second class can read the record and access the encrypted data, however, i try and set a third field and update the record and all hell breaks loose! The site goes straight to the Unauthorized page and there is nothing in the debug log around a failure and i cant catch any exceptions.
Checked apex security, page security, object CRUD and FLS and all is how it should be...
Any ideas where i should check next?
Found it!!
it was the old allowDML="true" chestnut when defining the Component.
Many thanks for all your inputs,
Chris
All Answers
The plot thickens!
Just hitting the page again and again with different System.Debug statements and it worked.... once.... and now it doesnt work again.
Something strange happening in the view state maybe? I'm grasping at straws here, think it might be time for sleep >:/
try creating a profile that matches the site public access settings
and try the same use case with a user that is tied to the new profile you created above.
You would be able to see the real error on the ui rather than the unauthorized error you see on the public page.
That sounds like a plan!
Sadly clients will get in the way of me trying this out until the weekend, i'll let you know how it goes.
Cheers
Found it!!
it was the old allowDML="true" chestnut when defining the Component.
Many thanks for all your inputs,
Chris