Home » Developer & Programmer » Forms » Do You Want to Save...
Do You Want to Save... [message #149163] Wed, 30 November 2005 07:02 Go to next message
Shaila.Mehra
Messages: 88
Registered: July 2005
Location: mumbai
Member

Hi everyone.
The message::
" Do You Want To Save The Changes You Have Made ?"When i press the button which query the records then this message comes with record and there are many more conditions where i faced this message.
And when i press NO option then it remove the message otherwise if i press the YES option it saves the record.
Third oion is NO.

So for gertting rid of this should i have to disable the insert property while query.
pls send me some tip to override this message.

Shaila.
Re: Do You Want to Save... [message #149176 is a reply to message #149163] Wed, 30 November 2005 07:59 Go to previous messageGo to next message
kiran
Messages: 503
Registered: July 2000
Senior Member
Check the block status , if it is "CHANGED" just commit the form using COMMIT or POST.

--Kiran.
Re: Do You Want to Save... [message #149177 is a reply to message #149163] Wed, 30 November 2005 08:01 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
First of all, you should know why you get this message. Does this message also occur without you having changed anything manually?

It means your record status has been changed, i.e. some field in the form has been changed either with or without your knowledge.

I'd say, check your post-query trigger. It is very often that the problem lies in there. Are there any database fields being updated there. If so, and they shouldn't be saved, set the record status property to QUERY_STATUS.

MHE
Re: Do You Want to Save... [message #150049 is a reply to message #149163] Tue, 06 December 2005 01:44 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you solved your problem?

David
Re: Do You Want to Save... [message #150131 is a reply to message #150049] Tue, 06 December 2005 08:26 Go to previous messageGo to next message
Shaila.Mehra
Messages: 88
Registered: July 2005
Location: mumbai
Member

I am attaching this .fmb(Scott's schema).
This is just an example here when i press the button it donot make any query. It wants a value to be entered first for query.

And when i give the value and press button then it again show that message about which we discussed earlier.

So how do i query the record by pressing the button.

Shaila.

  • Attachment: Error.fmb
    (Size: 48.00KB, Downloaded 2359 times)
Re: Do You Want to Save... [message #150253 is a reply to message #150131] Tue, 06 December 2005 22:49 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Help me out here. I don't have forms available to me but working through an intelligent flat file editor I believe that you have the following code in your form.

POST-QUERY (EMP)
BEGIN
  :dates := SYSDATE;
END;
WHEN-BUTTON-PRESSED (EMP.PUSH_BUTTON5)
BEGIN
  Go_block('emp');
  
  execute_query;
  
  IF :system.form_status = 'changed' THEN
    COMMIT;
  END IF;
END;

What is happening is that EVERY record that is retrieved is having its 'dates' field updated, the status will be set to 'CHANGED', and you are asking the form to 'commit'.

Now before we start correcting your code there are three things you SHOULD be doing.
1) ':dates' should be ':emp.dates' - ALWAYS specify block and item.
2) When testing Oracle defined values ALWAYS do them in upper case. So 'changed' should be 'CHANGED'.
3) In a Form use Commit_Form. It you want a commit done AND DONE NOW IRRESPECTIVE of the status of a form then use 'Standard.Commit'.

If you want Emp.Dates initialised to 'sysdate' then define the default value of Emp.Dates to '$$DATE$$' or '$$DATETIME$$'. If you want Emp.Dates to be updated when the record is changed then do it in a database trigger.

Okay, now remove the Post-Query trigger, remove the form_status code IF statement from the push_button, do a Ctrl-Shft-K (compile all), then a Ctrl-T (generate) and try you program again.

Tell us what extra behaviour you want from your form and we will help you with it.

David
Re: Do You Want to Save... [message #150353 is a reply to message #150253] Wed, 07 December 2005 08:33 Go to previous messageGo to next message
Shaila.Mehra
Messages: 88
Registered: July 2005
Location: mumbai
Member

Thanks for giving reply..
Now this time when i ran my form no item is updated and still i am getting same message.

It first needs a value for query and when the button pressed it retrieves records.

But i want that only by pressing a button it retrieves records.

Can you tell me more about the 'Standard.Commit'.

Shaila.
  • Attachment: Error.fmb
    (Size: 48.00KB, Downloaded 1936 times)
Re: Do You Want to Save... [message #150432 is a reply to message #150353] Wed, 07 December 2005 19:15 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Okay. Now you have:

WHEN-BUTTON-PRESSED (EMP.CLEAR)
CLEAR_FORM;
and WHEN-BUTTON-PRESSED (EMP.PUSH_BUTTON5)
EXECUTE_QUERY;
Do you have any 'initial values' set?

David
Re: Do You Want to Save... [message #151064 is a reply to message #149176] Mon, 12 December 2005 23:43 Go to previous messageGo to next message
Scarlet.Zhu
Messages: 22
Registered: December 2005
Location: Shanghai
Junior Member
kiran wrote on Wed, 30 November 2005 07:59

Check the block status , if it is "CHANGED" just commit the form using COMMIT or POST.

--Kiran.



FUNCTION GET_BLOCK_PROPERTY
(block_id Block,
property NUMBER);
FUNCTION GET_BLOCK_PROPERTY
(block_name VARCHAR2,
property NUMBER);

Do these functions above retrieve block status???

Thanks!
Scarlet
Re: Do You Want to Save... [message #151216 is a reply to message #151064] Tue, 13 December 2005 16:15 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
You can get the current block status using System.Block_Status and the status of any block ('blk') using Get_Block_Property('blk',STATUS).

David
Re: Do You Want to Save... [message #275909 is a reply to message #151064] Tue, 23 October 2007 05:59 Go to previous messageGo to next message
unthirudan
Messages: 3
Registered: July 2007
Location: India
Junior Member
Hi...

I wannna know what will the POST statement do... If i delete a record from the current block on screen, and wanna undo this operation.. i.e., i wanna rollback, or undo the delete operation...

Here should i use the POST statement..... Or anything else...

Bcze if i use the COMMIT or COMMIT_FORM the delete record will be saved in the database... How to undo this delete operation...

I have put a button and added the following script
DELETE_RECORD when the button is pressed....

I have kept another button to cancel this delete record....

Pls Help...
Valentine M
Re: Do You Want to Save... [message #276080 is a reply to message #275909] Tue, 23 October 2007 19:45 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
POST is similar to COMMIT (database triggers fire, constraints are tested) but a ROLLBACK will undo ALL changes since the last SAVEPOINT was issued, not just the last command that you issued.

If you want to be able to select which record to delete and undelete then consider adding an 'operation' column/item to the record. Then, on a 'delete', mark it with a 'D'. Then when you 'SAVE' your changes, you run a 'delete' statement which will physically delete all records marked with a 'D'. To undo the 'delete' (before the 'SAVE' is run) you would just remove the 'D' from the 'operation' column.

David

PS Please use 'want to' instead of 'wanna'.
Re: Do You Want to Save... [message #302048 is a reply to message #149163] Fri, 22 February 2008 16:00 Go to previous messageGo to next message
marvSQL
Messages: 13
Registered: February 2008
Location: JAMAICA
Junior Member
i have a similar problem.i am new to oracle developement.
i have form with a master-detail relationship.

tables involved are:
--------------------------
department --being the master
employee --being the detail table


i have attached the form for viewing.

i attached an l-o-v to fill the department fields.
what i wanted was that each tim that i change the department via the l-o-v a listing of all employees under that department is to be shown.
but each time i select a new department using the l-o-v the message(Do You Want To Save The Changes You Have Made ) comes up.how can i suppress this message?
Re: Do You Want to Save... [message #302215 is a reply to message #302048] Sun, 24 February 2008 22:55 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Are you making any changes to your records or do you believe that this message is being raised in error?

David
Re: Do You Want to Save... [message #302222 is a reply to message #302048] Sun, 24 February 2008 23:33 Go to previous messageGo to next message
sasipalarivattom
Messages: 121
Registered: June 2007
Location: Cochin ( INDIA )
Senior Member
Dear Marvy,
The problem is because your LOV assigns values to DEPARTMENT_ID and DEPARTMENT_NAME fields.
as the values are assigned to the fields, block status will be modified as 'CHANGED' .
Since it is a datablock, it will ask you wether to save this new values.

Now what you have to do is simple.

1. Create a parameter DEPTID to save the department_id (primary key).
2. In the LOV ,change the return value of deparment_id to this parameter.
3. In the KEY-LISTVAL trigger, modify the code like this
  LIST_VALUES;
  clear_form(no_validate);
  EXECUTE_QUERY;
  

4. Now in PRE-QUERY Trigger of DEPARTMENT ,write this code.

  if :parameter.DEPTID is not null then
	:DEPARTMENT.DEPARTMENT_ID:=:parameter.DEPTID;
        :parameter.DEPTID:=null;
  end if;
  


Now run the form.
I think you understood the coding. If need clarifications, Please reply.

Regards
Sasi..
Re: Do You Want to Save... [message #302416 is a reply to message #149163] Mon, 25 February 2008 09:59 Go to previous messageGo to next message
marvSQL
Messages: 13
Registered: February 2008
Location: JAMAICA
Junior Member
thanks djmartin and sasipalarivattom for your qick responces.

to answer djmartin's question: no i did not want to make any change to the record. i only wanted the values selected from the l.o.v to be displayed in the DEPARTMENT_ID and the DEPARTMENT_NAME fields of my form but according to sasipalarivattom the block status will be modified as 'CHANGED'.
i now understand. thanks guys!!


Re: Do You Want to Save... [message #302878 is a reply to message #302416] Wed, 27 February 2008 04:17 Go to previous messageGo to next message
sasipalarivattom
Messages: 121
Registered: June 2007
Location: Cochin ( INDIA )
Senior Member
Dear Marvy,
Is it working properly now?

Regards
sasi...
Re: Do You Want to Save... [message #303513 is a reply to message #302878] Fri, 29 February 2008 11:40 Go to previous messageGo to next message
marvSQL
Messages: 13
Registered: February 2008
Location: JAMAICA
Junior Member
sasipalarivattom , i made the modifications that you told me to do.when i press the button the l.o.v did not launch.the employee datablock was filled with all the emploees.
-----------------------------------------------

I then commented the code in the key-listval trigger of DEPARTMENT.DEPARTMENT_ID :

LIST_VALUES;
--clear_form(no_validate);
EXECUTE_QUERY;

I then compiled and ran program again.it gave the following results:
* the first time the button is pressed after i run the program, the l.o.v does not show up.but the first record in the department table show up in the DEPARTMENT datablock and the employees related to that department shows up in the EMPLOYEE datablock
*if the button is pressed again(for the second time and all other attemps after that) the l.o.v shows up and everthing seems to work perfectly

i just dont know why the l.o.v doesnt show up when the button is pressed the first time
Re: Do You Want to Save... [message #304113 is a reply to message #303513] Tue, 04 March 2008 02:07 Go to previous messageGo to next message
sasipalarivattom
Messages: 121
Registered: June 2007
Location: Cochin ( INDIA )
Senior Member
Can you attach the latest fmb?
Re: Do You Want to Save... [message #305341 is a reply to message #304113] Mon, 10 March 2008 08:32 Go to previous messageGo to next message
marvSQL
Messages: 13
Registered: February 2008
Location: JAMAICA
Junior Member
here is the new fmb file
Re: Do You Want to Save... [message #307607 is a reply to message #305341] Wed, 19 March 2008 04:44 Go to previous messageGo to next message
sasipalarivattom
Messages: 121
Registered: June 2007
Location: Cochin ( INDIA )
Senior Member
Dear Marvy,

Sorry for the late reply.
can you try the form now?

I made some changes.

1. In the lov button
( Changed the command "execute_trigger" to "do_key" )
2. In KEY-LISTVAL trigger of 'DEPARTMENT_ID' fileld
3. In the Datablock position( Department block moved up ).

Regards
sasi...
Re: Do You Want to Save... [message #308831 is a reply to message #307607] Tue, 25 March 2008 10:58 Go to previous messageGo to next message
marvSQL
Messages: 13
Registered: February 2008
Location: JAMAICA
Junior Member
thanks a lot sasi!! it worked perfectly !!
what i would like to know is why was it behaving this way before you made the changes.
Re: Do You Want to Save... [message #310666 is a reply to message #308831] Wed, 02 April 2008 00:22 Go to previous messageGo to next message
sasipalarivattom
Messages: 121
Registered: June 2007
Location: Cochin ( INDIA )
Senior Member
Dear Marvy,

What would I like to say is
Check it yourself. Once if you can understand what is wrong in your
form, you will never forgot it.
One more thing, Do post your thoughts for the use of other members.

One suggestion.
What I heard from my seniors is that use "execute_trigger" command
only when there isn't any other way..

Thanks and Regards
Sasi..
Re: Do You Want to Save... [message #659771 is a reply to message #310666] Mon, 30 January 2017 07:11 Go to previous messageGo to next message
naveenbavu
Messages: 1
Registered: January 2017
Junior Member
Hi All,
I am new one to this forum, i have one question.. when I enter one code and do query immedietly it was showing me "Do you want me to save changes you have made?"
I didn't change any values I have just entered one code field which give me data from two tables which has relationship and populate two databablocks.
Someone please help me on this issue?
Re: Do You Want to Save... [message #659775 is a reply to message #659771] Mon, 30 January 2017 07:56 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
The code you entered was exactly that: you modified item's value. Forms warns you that you'll lose those changes and asks whether you want to save them or not.
Re: Do You Want to Save... [message #659777 is a reply to message #659771] Mon, 30 January 2017 08:03 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
naveenbavu wrote on Mon, 30 January 2017 08:11
when I enter one code and do query immedietly it was showing me "Do you want me to save changes you have made?"
And to follow-up from Littlefoot, if you want to query records, you need to enter into query mode before you type into a field, not the other way around.
Re: Do You Want to Save... [message #659778 is a reply to message #659775] Mon, 30 January 2017 08:04 Go to previous message
cookiemonster
Messages: 13919
Registered: September 2008
Location: Rainy Manchester
Senior Member
You need to go into enter-query mode before entering a value for forms to use in the query.
Previous Topic: formsweb.cfg configuration
Next Topic: OLE2 Usage-Documentation Information
Goto Forum:
  


Current Time: Tue Apr 16 08:29:28 CDT 2024