Check if a record needs a save
21:42 Nov 07, 2020
Hello,
How does the save button on an edit page know when to appear? This is the property I would like access to as well.
Thanks
Like
3 comments
Best reply
00:36 Nov 08, 2020
You can use this to determine if the record needs saving (if the save button is showing)
if (this.get("ShowSaveButton")) { // needs saving }
Ryan
00:36 Nov 08, 2020
You can use this to determine if the record needs saving (if the save button is showing)
if (this.get("ShowSaveButton")) { // needs saving }
Ryan
12:59 Jun 19, 2025
Ryan Farley,
Hi Ryan,
Any possibilities in freedom UI for this?
18:41 Jun 19, 2025
Geeviniy Vazavan,
For Freedom UI you can check the attribute “HasUnsavedData”. This will tell you if the page needs to be saved.
const needsSave = await request.$context.HasUnsavedData; if (needsSave) { // do somehting }
Additionally, you can listen for changes to this attribute as well to respond to when it changes:
{ request: "crt.HandleViewModelAttributeChangeRequest", handler: async (request, next) => { if (request.attributeName === "HasUnsavedData" && request.value) { // the form needs saving, request.value will be true if needs saving } return next?.handle(request); } }
Ryan
Show all comments