Skip to Content
0
Jan 06, 2021 at 12:34 PM

SAP Lumira Designer 2.3 - Planning Application showCloseWarning

119 Views

Hi Community,

I have a basic planning application created using Lumira Designer 2.3 SP02. The planning input is made via the Spreadsheet component. I have a number of error catching checks in place within teh application and I have also made use of the showCloseWarning API. The following script is placed on teh DS 'On Results Set Change':

if (Planning.hasClientChanges() || Planning.hasUnsavedChanges()) {

APPLICATION.showCloseWarning(true, "Unsaved Planning Changes");

}

else {

APPLICATION.showCloseWarning(false);

}

I am testing this in Chrome (Version 87.0.4280.88 (Official Build) (64-bit)) and the warning message appears when closing the application via the browsers tab itself:

However, I'm hitting an issue with two scenarios:

1. Closing the application within the Fiori Launchpad

If I close the application using the above method (when the application has Unsaved Changes), I don't get any warning message and the application will just close.

2. Closing the application within the Fiori Launchpad

If I close the application using the above method (when the application has Unsaved Changes), I get the warning message but if I choose 'Cancel' the application will just close regardless (slightly different to the Fiori case).

Maybe I need to use a different alert type to cater for such scenarios (as we're not actually closing a browser tab) but I would appreciate any thoughts/advice.

Regards,

Emmet.