I'm trying to use force:createRecord and it works okay in Lightning Experience, and S1 but but I get the following error message when I am using a stand alone app. If I preview the "sampleCreateRecordApp.app" I get the below error message:

"This page has an error. You might just need to refresh it. Action failed: c:sampleCreateRecord$controller$createRecord [Cannot read property 'setParams' of undefined] Failing descriptor: {c:sampleCreateRecord$controller$createRecord}"

Below is the simple compoment I'm trying to get to work in a stand alone app (or lightning out). The documentation link here alludes that they can be used outside of LEX or S1

If I try to extend the application with extends="ltng:outApp" the application does not render at all. Any advice would be great. Thanks!


<apex:page >

    <script src="/lightning/lightning.out.js" />
    <div id="sampleComponentDiv" />    

        $Lightning.use("c:sampleCreateRecordApp",function() {



<aura:application >



 <aura:component implements="flexipage:availableForAllPageTypes">
    <lightning:button variant="brand" label="Submit" onclick="{! c.createRecord }" />



    createRecord : function (component, event, helper) {
        var createRecordEvent = $A.get("e.force:createRecord");
            "entityApiName": "Contact"
  • can you share your visualforce page code also? Commented Feb 23, 2017 at 5:52
  • I updated my post to include the visualforce page as well. Thanks for your help in advance!
    – jojopogi
    Commented Feb 23, 2017 at 18:31

2 Answers 2


The force:createRecord feature is unsupported for ligtning out - as stated in the documentation:

This event is handled by the one.app container. It’s supported in Lightning Experience, the Salesforce app, and Lightning communities.

That means - not available on lightning out and therefore inside a visualforce page.

  • The documentation link you provided is not working. Can you please share the link again Commented Jun 29, 2018 at 2:04
  • @MonalisaDas updated! Commented Feb 5, 2019 at 13:10
  • wre you able to do it with any work arounds ?
    – ScoRpion
    Commented Apr 22, 2019 at 13:22

@Monalisa Das

You can find the updated documentation here - force:createRecord Documentation

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .