Link to home
Start Free TrialLog in
Avatar of basilhs_s
basilhs_s

asked on

powerbuilder , check datawindow status

suppose that we have a window that contains datawindow dw_1. suppose that the users starts entering data  and by mistake closes the window before save them. We want to send him a message indicating that the changes that he made will be lost.  we want deal with this issue in the following cases.

1) if the user enters data to store them in a new record (no retrieve has been done)
2) if the user retireves a record and correct some data in it

how can we do it?

Avatar of gafoor78
gafoor78
Flag of India image

You can use  modifiedcount, getitemstatus function of datawindow to achieve this..see PB help for syntax and all.

write those scripts in closequery event of the window,

if something modified or added or deleted then put a messagebox and ask do you want to save changes,
then based on response save the datawindow and close or stop closing by returning 1 from closequery event.

Thanks,
Gafooor
ASKER CERTIFIED SOLUTION
Avatar of gafoor78
gafoor78
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of basilhs_s
basilhs_s

ASKER

thanks all for the reply. suppose that we do the save. will this event reset all the counters you mentioned ?
do we have to retrieve the data again?
yes it will reset the count. No need to retrieve the data again
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thans very much