3

I have Lightning App ( < aura:application extends="force:slds" > ) with some components: comboboxes, buttons, controllers, helpers etc. (everything works).

I made everything according to ( https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_lightning_overlayLibrary.htm ) SF dev page.

and there is

<lightning:overlayLibrary aura:id="overlayLib"/>

in my component ( or < lightning:notificationsLibrary aura:id="notifLib" / > ), controller has code:

   var c = component.find('overlayLib');
    c.showCustomModal({
        header: "Modal header section",
        body: "Content of Modal window",
        showCloseButton: true,
    });

however, when i run this code, i can see error in a console:

TypeError: $A.J.Vg(...) is undefined

and nothing is displayed. showCustomModal returns a promise, so something is happening:

Promise { "pending" }
<state>: "pending"
__proto__: PromiseProto
catch: function catch()
constructor: function Promise()
finally: function finally()
l: function then()
then: function then()
Symbol(Symbol.toStringTag): undefined
__proto__: Object { … }

other Lightning related things work (components, controllers, etc.)

How to use Overlay/Notifications Libraries ? How to make them visible ?

  • 1
    Are you doing this in a component that appears in LEX or Communities? Visualforce? Lightning App? – sfdcfox Feb 9 '18 at 15:00
  • It's a Lightning App, app extends force:slds <aura:application extends="force:slds"> other components work, comboboxes, buttons, controllers, helpers etc. – razor Feb 12 '18 at 9:58
1

As stated in the documentation:

This component is supported in Lightning Experience, Salesforce app, and Lightning communities only.

Lightning Apps are not LEX, Salesforce, or LEX Community, so this feature won't work there. It's always important to check the documentation to see if a feature is supported in Lightning Apps (if it is, there won't be a note that the component only works in LEX).

  • thanks, i don't know what's the difference between lightning app, lightning experience, lightning communities, salesforce app... looks like quite big chaos.... – razor Feb 13 '18 at 17:12
  • 1
    @razor Lightning can be used almost anywhere. There's two basic categories for this: standard Salesforce Lightning apps, and everything else. LEX is the browser-based Lightning Experience when you log in and switch to it, Salesforce app is the mobile app you install on a phone or tablet, and Lightning Communities is a Community that uses Lightning (e.g. Napili). These support all components. Everything else includes Lightning Apps (AuraDefinitionBundle with an .app file), Lightning Out, Visualforce, etc. These do not support components that have this note in the documentation. – sfdcfox Feb 13 '18 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.