function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jessimcqjessimcq 

Opportunity - Unauthorized User Upsert Failing through Visualforce-embedded Flow via Site

This person was having basically the same issue I'm getting:

http://boards.developerforce.com/t5/General-Development/Error-running-flow-on-Site/m-p/470047#M76773

 

But uh... the 'solution' was that there wasn't actually a problem, so let me take a crack at it.

 

I would like to start by saying that I'm still pretty new to this stuff. I have created a flow that allows users to update custom fields on an Opportunity, defined by the varOpptyId variable I have populated with a test assignment step at the very beginning of the flow. This flow is embedded in a Visualforce page, and works perfectly for users logged into our org.

 

I then set up a Site.com site so that our customers can use the flow as unauthorized users. I set up the permissions so that the guest profile has access to both objects referenced in the flow (Account and Opportunity) and all fields on those objects that are referenced. The user can run the flow just fine up until the record update, at which point we receive this Unhandled process fault:

 

 

Encountered unhandled fault when running process New_Homeowner_Renewal_Flow/301d00000004WEq exception by user/organization: 00Dd0000000dMWk/{4}

 

UPSERT --- UPSERT FAILED ---  ERRORS :  (CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY) entity type cannot be updated: Opportunity ---  for SFDC record with ID : null,

 

caused by element : Data update.Set_Renewal_in_Progress_0

 

caused by: UPSERT --- UPSERT FAILED ---  ERRORS :  (CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY) entity type cannot be updated: Opportunity ---  for SFDC record with ID : null,

 

Salesforce Error ID: 1391988153-63159 (1899379434)

 

 


When I take this step out, the user can make it to the end of the flow where there is another record update, at which point the flow fails again but does not throw me any errors to post.

 

I have checked the debug logs and everything says 'success'. Here is the latest one:

 

28.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
18:35:21.029 (29772000)|EXECUTION_STARTED
18:35:21.029 (29820000)|CODE_UNIT_STARTED|[EXTERNAL]|066d0000001xb4h|VF: /apex/Marketplace_Homes_Homeowner_Renewal
18:35:21.177 (177601000)|VF_SERIALIZE_VIEWSTATE_BEGIN|066d0000001xb4h
18:35:21.180 (180135000)|VF_SERIALIZE_VIEWSTATE_END
18:35:22.071 (186742000)|CUMULATIVE_LIMIT_USAGE
18:35:22.071|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 2 out of 100
  Number of query rows: 2 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Number of code statements: 0 out of 200000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

18:35:22.071|CUMULATIVE_LIMIT_USAGE_END

18:35:21.186 (186791000)|CODE_UNIT_FINISHED|VF: /apex/Marketplace_Homes_Homeowner_Renewal
18:35:21.186 (186802000)|EXECUTION_FINISHED

 

This is super important to our business and I am having the worst time trying to figure it out. Any help would be much appreciated. Does anyone have any thoughts?

Thank you in advance!

Best Answer chosen by Admin (Salesforce Developers) 
kmwienkenkmwienken
Are you sure you're looking at the right profile? Your customers are hitting the Visualforce page on a Force.com site without ever logging in correct?

This states that guest users cannot have edit on any standard objects, http://wiki.developerforce.com/page/Authenticating_Users_on_Force.com_Sites.

All Answers

kmwienkenkmwienken
Does the profile have edit access? I don't believe the guest user license can give edit access to standard objects.
jessimcqjessimcq

It has both read and edit priveleges on all of the fields, as well as general record create/edit priveleges.

kmwienkenkmwienken
Are you sure you're looking at the right profile? Your customers are hitting the Visualforce page on a Force.com site without ever logging in correct?

This states that guest users cannot have edit on any standard objects, http://wiki.developerforce.com/page/Authenticating_Users_on_Force.com_Sites.

This was selected as the best answer
jessimcqjessimcq

That's really odd, 'edit' is an option on the field level for Opportunity...

 

Thank you so much for the link, I will check back in a bit after some testing!

jessimcqjessimcq

You were totally right!! Thank you so much. I transfered the info to a custom object and set up workflows to update the Opportunity :)

 

Thank you again!