Does anyone have an idea how to use lightning system events like showToast or navigateToSObject with namespace of managed package (let us say the namespace is xyz).

var toastEvent = $A.get("e.force:showToast");
                title : 'Success',
                message:'Record has been created',
                messageTemplate: 'Mode is pester ,duration is 4sec and Message is overrriden',
                duration:' 4000',
                key: 'info_alt',
                type: 'success',
                mode: 'pester'
  • 1
    What do you mean, exactly? Those events will always have the namespace of the "force" package (or whichever namespace they may come from). – sfdcfox Dec 11 '18 at 19:56
  • Do you mean that for standard ones there is no need to add any namespace unlike the user defined app events? in developer guide there is an example of user defined app event. It does not say anything about standard/system events developer.salesforce.com/docs/atlas.en-us.lightning.meta/… – user10268395 Dec 11 '18 at 19:58
  • 1
    That's correct. One should be aware that some events are only available in Salesforce1/Communities/LEX, but assuming they are, the namespace would not change for those events. – sfdcfox Dec 11 '18 at 20:01

You do not need to worry about taking care of namespace for these events . When the package is packaged salesforce takes care of adding the namespace so keep it standard as it is with "e" for events and "c" for components.

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.