I need to revert a value on a page to what it was at the time the page was opened if the user clicks 'No' on the confirmation dialog.
This is what I have now.
OnOpenPage()
ActiveStatus := Active;
CloseStatus := Close;
...
OnQueryClosePage(CloseAction : Action None) : Boolean
ReviewPeriod.GET(Code);
PhaseNo := Name;
IF Close <> CloseStatus THEN BEGIN
ConfirmChanges := ConfirmMsg;
Answer := DIALOG.CONFIRM(ConfirmChanges, TRUE, PhaseNo);
IF Answer THEN
EXIT;
IF NOT Answer THEN BEGIN
Rec.Close := CloseStatus;
EXIT;
END;
END;
Hi, What happens if you close the current page and reopen it in your code? I tested in Card Page, this works.
Hope this helps
Thanks.
ZHU
Updated:
Check if property RefreshOnActivate is on for ListPage
NorthW That's not really necessary because that field is exclusive to that page. So, unless changes are made in the development environment, it should be fine.
Thanks raibilalhaider . It works but the changes are made on a card page and do not reflect on the corresponding list page unless I refresh it. Any suggestions?
I think you also should look into doing this in the OnValidate trigger on the table instead of in the page.
What if your data it modified outside of this one page?
Hi,
I think you just need to call Rec.MODIFY before EXIT in last third line. Rest of code look fine.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,151 Super User 2024 Season 2
Martin Dráb 229,993 Most Valuable Professional
nmaenpaa 101,156