Skip to main content
I have a flow that I run from the flow interface is able to update opportunity fields on existing opportunities.  That is of course because is running under the content of my salesforce user with permissions for edit based on my profile.  If I embed the flow in a visual force page I'm not able to update the opportunities fields for existing opportunities (edit permission).  That is because running as the guest profile related to the site profile permissions which doesn't an option to allow edit access for opportunity objects.  For custom objects you can enable edit for existing objects and works just fine.

 

I'm thinking there must be a way to allow Edit/Public Full Access to opportunity objects because it is working for Campaign Members.  If I set Public Full Access for the Campaign in Setup -> Sharing Settings then I'm able to update existing campaign member object fields from flow running in a visualforce page using the guest profile.  What is weird is on the site profile settings Campaigns under the standard objects doesn't have an Edit permission to check but under Setup -> Shared Settings.  The default setting in setup -> shared settings though there is an option for Public Full Access but Campaign object is the only object you can set the default to Public Full Access.

 

Is there a way to setup Opportunities so I can edit existing opportunities from flow running in the content of a site guest profile within a VisualForce Page?
답변 1개
  1. 2017년 9월 15일 오전 5:24
    Hi Dave,

     

    You can code the controller as without sharing and copy the values into and out of an intermediate object.

     

    The documentation for with sharing states:

     

    The with sharing keyword allows you to specify that the sharing rules for the current user be taken into account for a class. You have to explicitly set this keyword for the class because Apex code runs in system context. In the system context, Apex code has access to all objects and fields— object permissions, field-level security, sharing rules aren’t applied for the current user.

     

    So, by specifying without sharing the class runs in system context and has access to the Opportunity. Note that doesn't apply to the Visualforce page, itself, so you couldn't access the Opportunity directly in it via an inputField.

     

    Thanks

     

    Vaishali Kaushik

     

    Mirketa inc.
0/9000