• Deepak Gupta 75
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi I'm trying to follow the example here https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_one_demo_load.htm.

Atfter setting it up, I got this error when previewing it by clicking on the preview button:
Something has gone wrong. Unable to get property 'setParams' of undefined or null reference. Please try again.

I think it's the helper js "getContacts" where

var toastEvent = $A.get("e.force:showToast");
            if (state === 'SUCCESS'){
                toastEvent.setParams({
                    "title": "Success!",
                    "message": " Your contacts have been loaded successfully."
                });
            }

e.force:showToast appears to be a system function. Can someone confirm? Does this function only work on Salesforce1?