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
Jacob ChambersJacob Chambers 

Disable Modals/Popups in lightning

Anyone know of a way to disable or customize the text of the modals/popups that appear in Lightning when a record is saved or stage is changed, etc.?
Alain CabonAlain Cabon
Hi,

The standard labels are loaded from a hard coded list in javascript (Aura).

var auraConfig = { ...  "MobileWebRecordActions":{"ToasterMessageDelete":"{0} {1} was deleted.","AdditionalRecordActions":"Additional Record Actions","ToasterMessageCreate":"{0} {1} was created.","ToasterMessageUpdate":"{0} {1} was saved.","ToasterMessageCreateWithoutName":"{0} was created.","ToasterMessageMassQuickActionUpdate":"{0} actions were completed."},"SelectElement":{"Required":"--None--"},"Error":{"toastTitleGenericLabelForRecord":"You encountered some errors when trying to save this record","selectAStage":"Select a {0}","toastTitle":"You encountered some errors when trying to save \"{0}\""  .... }

You can access these "system" values but you cannot change them.
<aura:application >
    <aura:handler name="init" value="{! this }" action="{! c.doInit }"/>
    <aura:attribute name="myvalue" type="String" />
    my value: {!v.myvalue}
</aura:application>
({
    doInit : function(component, event, helper) {
        component.set('v.myvalue',	$A.get("$Label.MobileWebRecordActions.ToasterMessageUpdate"));   
    }
})

$A.set("$Label.MobileWebRecordActions.ToasterMessageUpdate","{0} {1} a été sauvé");

You cannot change this value with a $A.set in the javascript lightning controller.

http://documentation.auraframework.org/auradocs#reference?topic=api:$A

The standard labels should appear in the translation workbench ( Setup > Translation Workbench > Translate ) but that doesnt exist either..

These standard "toaster message" cannot be deactivated either.

A workaround would be to "capturing" the events  (  https://github.com/forcedotcom/LightningTestingService/issues/39 )
But if a "toaster message" is fired, it will be shown whatever happens.