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
jojoforcejojoforce 

Use force:createRecord in a stand alone app or lightning out?


According to the documentation found in this link, the force:createRecord is one of the out-of-the-box events to enable components to view or create a record. The documentation says that its only available in Lightning Expererience (LEX) or Salesforce1 (S1), HOWEVER, if you fire these events outside of LEX or S1 you have to handle the event and register the event. I couldn't find any good examples on how to do so and any help is greatly appreciated. Essentially, my use case is be able to create a record for an object in a stand alone app, LEX or S1. Currently, I am able to create a record for just LEX and S1 but when I do so with a stand alone app, it does not fire. 


https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_events.htm

Use out-of-the-box events to enable component interaction within Lightning Experience or Salesforce1, or within your Lightning components. For example, these events enable your components to open a record create or edit page, or navigate to a record.
If you fire one of these events in your Lightning apps or components outside of Salesforce1 or Lightning Experience:
  • You must handle the event by using the <aura:handler> tag in the handling component.
  • Use the <aura:registerEvent> or <aura:dependency> tags to ensure that the event is sent to the client, when needed.
NagendraNagendra (Salesforce Developers) 
Hi,

May I suggest you please check with below link with a similar issue. Mark it as solved if it's resolved.

Best Regards,
Nagendra.