[SalesForce] Any Way to Enable Site Login Without Portals or Communities

I have a public site/page that uses a visual workflow to create a task based on inputs. However, because guests do not have the permissions to create tasks or events – I need to figure out an alternative way to do this.

One way I thought would be to login as a system administrator or other user with sufficient permissions. However, the customer portal and communities does not exist under my Customize Applications.

Is there anyway to enable login on my Visualforce Pages without Customer Portals or Communities?


Have spent 2+ weeks working on this to no avail and would really appreciate any help! Would appreciate any help as I tear my hair out! Thank you!

Best Answer

Apologies for not being able to give a more specific answer, but I had eventually solved my issue using the below apex code that I custom wrote. However, it was about 2 years ago and was for a client project which I have since removed my access for.

Hopefully it can be helpful for someone in the future - Cheers!

// Create Task for Sign In
public without sharing class JSDCLSignInTask implements Process.Plugin {
    //runs when called by flow's Apex plug-in element.
    public Process.PluginResult invoke(Process.PluginRequest request) {

        // Set up variables to store input parmeters from the flow
        // String OwnerId = (String) request.inputParameters.get('OwnerId');
        String Priority = (String) request.inputParameters.get('Priority');
        String Status = (String) request.inputParameters.get('Status');
        String Subject = (String) request.inputParameters.get('Subject');
        String Type = (String) request.inputParameters.get('Type');
        String WhoId = (String) request.inputParameters.get('WhoId');
        //Date ActivityDate = (Date) request.inputParameters.get('Date');

        // Create Task
        createTaskSignIn(Priority, Status, Subject, Type, WhoId);

        // Return to flow
        Map<String,Object> result = new Map<String,Object>();
        return new Process.PluginResult(result);
    }

    // Describe plug-in and inputs from and outputs to the flow
    // Implementing this adds the class to the Flow Designer Palette
    public Process.PluginDescribeResult describe() {
        // Set up plugin metadata
        Process.PluginDescribeResult result = new Process.PluginDescribeResult();
        result.description = 'Create sign-in task';
        result.tag = 'Create Sign In Task';

        // Create list of mandatory and optional input params
        result.inputParameters = new
            List<Process.PluginDescribeResult.InputParameter>{
            // Priority (mandatory)
            new Process.PluginDescribeResult.InputParameter('Priority', Process.PluginDescribeResult.ParameterType.STRING, true),
            // Status (mandatory)
            new Process.PluginDescribeResult.InputParameter('Status', Process.PluginDescribeResult.ParameterType.STRING, true),
            // Subject (mandatory)
            new Process.PluginDescribeResult.InputParameter('Subject', Process.PluginDescribeResult.ParameterType.STRING, true),
            // Type (mandatory)
            new Process.PluginDescribeResult.InputParameter('Type', Process.PluginDescribeResult.ParameterType.STRING, true),
            // WhoId (mandatory)
            new Process.PluginDescribeResult.InputParameter('WhoId', Process.PluginDescribeResult.ParameterType.STRING, true)    
        };

        return result;

    }

    // Create Task for Sign In Function
    // createTaskSignIn(Priority, Status, Subject, Type, WhoId);

    public void createTaskSignIn(String Priority, String Status, String Subject, String Type, String WhoId) {
        Task newTask = new Task(
            Priority = Priority,
            Status = Status,
            Subject = Subject,
            Type = Type,
            WhoId = WhoId,
            ActivityDate = Date.today(),
            OwnerId = '005A0000002jz1n'
        );

        Insert newTask;
    }

}