Home » Developer & Programmer » Forms » prevent commit after execute_query (forms 6i)
prevent commit after execute_query [message #393845] Tue, 24 March 2009 11:12 Go to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

Hi all,

I am using the following to search for a record, but before the record is viewable it always ask me "Do you want to save changes you have made", I hit "no" and the record shows. How can I stop this message from displaying?

Code used:
set_block_property('FIND_INC_RECORDS',default_where,'PERSON_ID = '||chr(39)||:FIND_INC_RECORDS.PERSON_ID||chr(39));
Go_block('FIND_INC_RECORDS');

execute_query;
Re: prevent commit after execute_query [message #393847 is a reply to message #393845] Tue, 24 March 2009 11:15 Go to previous messageGo to next message
cookiemonster
Messages: 12410
Registered: September 2008
Location: Rainy Manchester
Senior Member
I assume you're not going into enter-query mode before assigning a value to :FIND_INC_RECORDS.PERSON_ID?
Re: prevent commit after execute_query [message #393848 is a reply to message #393847] Tue, 24 March 2009 11:22 Go to previous messageGo to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

No, should I?
Re: prevent commit after execute_query [message #393850 is a reply to message #393845] Tue, 24 March 2009 11:31 Go to previous messageGo to next message
cookiemonster
Messages: 12410
Registered: September 2008
Location: Rainy Manchester
Senior Member
That's the standard way of querying records.
You shouldn't need to mess around with default_where then.

Basically you're setting a value to use in a query, but because you're not in enter-query mode forms doesn't know that is what your doing and it assumes you're trying to create a new record.
Hence it asks you if you want to save the changes you made.

Always use forms default behaviour unless it really doesn't work for your requirements.
Re: prevent commit after execute_query [message #393851 is a reply to message #393850] Tue, 24 March 2009 11:34 Go to previous messageGo to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

ok, thanks.

So how would enter_query work to pull record based on the person_id?
Re: prevent commit after execute_query [message #393852 is a reply to message #393845] Tue, 24 March 2009 12:09 Go to previous messageGo to next message
cookiemonster
Messages: 12410
Registered: September 2008
Location: Rainy Manchester
Senior Member
enter_query

enter value in person_id field

execute_query
Re: prevent commit after execute_query [message #393854 is a reply to message #393852] Tue, 24 March 2009 13:14 Go to previous messageGo to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

Thanks for the response, but it is still asking me to save.

I have.....

go_block('find_inc_records');
enter_query;
--person_id is copied to field in this block from a LOV execute_query;

Its now taking even longer to execute.
Re: prevent commit after execute_query [message #393875 is a reply to message #393845] Tue, 24 March 2009 15:07 Go to previous message
cookiemonster
Messages: 12410
Registered: September 2008
Location: Rainy Manchester
Senior Member
Presumably it's now asking when you do enter_query.

There's some code that's changing the record status to insert, you need to find it and remove it.
Previous Topic: Thumb Scanner with forms
Next Topic: CLEAR THE LIST ITEM
Goto Forum:
  


Current Time: Wed Dec 07 06:40:16 CST 2016

Total time taken to generate the page: 0.12218 seconds