Home » Developer & Programmer » Forms » Do u want to save the changes (forms 6i)
Do u want to save the changes [message #397335] Fri, 10 April 2009 02:11 Go to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
Hi,

I designed one form such that, when i enter emp_code and clicked on ok button, I should get all the details corresponding to that code.
if there is no data corresponding to that code means i should get an message as 'NO ENTRY MADE FOR THIS EMPLOYEE';
I wrote the following code in the when button pressed trigger

DECLARE
BEGIN
go_block('M_AUTHORITY') ;
set_block_property( 'M_AUTHORITY' ,DEFAULT_WHERE, ' WHERE emp_code = ' || '''' || :m_authority.emp_code || '''' ) ;
execute_query;
set_block_property('M_AUTHORITY', DEFAULT_WHERE, '');

But I am getting an alert 'Do U Want To Save The Changes',when i click on the button, though no changes made.
when no data is availale also the same message i am getting.

In order to get'no entry made.......'message where i have to write the code,if no data is found corresponding to that emp_code.

please help me to solve this problem.
Re: Do u want to save the changes [message #397380 is a reply to message #397335] Fri, 10 April 2009 07:25 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
But, changes have been made ... once you've entered EMP_CODE into an item, Forms considered this record changed.

However, why are you reinventing the wheel? Forms has developed querying ages ago and it works just fine:
- press ENTER_QUERY
- enter value into the "emp_code" item
- press EXECUTE_QUERY

Nothing more, nothing less. No coding at all.
Re: Do u want to save the changes [message #397565 is a reply to message #397335] Sun, 12 April 2009 13:16 Go to previous messageGo to next message
expertsudhir
Messages: 26
Registered: October 2008
Location: Delhi, India
Junior Member

You just put "clear_block (no_validate)" after go_block like:


DECLARE
BEGIN
go_block('M_AUTHORITY') ;
clear_block (no_validate);
set_block_property( 'M_AUTHORITY' ,DEFAULT_WHERE, ' WHERE emp_code = ' || '''' || :m_authority.emp_code || '''' ) ;
execute_query;
set_block_property('M_AUTHORITY', DEFAULT_WHERE, '');

------
Re: Do u want to save the changes [message #397568 is a reply to message #397565] Sun, 12 April 2009 13:31 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
But, CLEAR_BLOCK will also invoke "Do you want to save changes" message ...

Besides, once the block is cleared, ":m_authority.emp_code" will be empty and DEFAULT_WHERE will not do what it is supposed to.
Re: Do u want to save the changes [message #398356 is a reply to message #397568] Thu, 16 April 2009 01:50 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Then don't use a database item. make your field a non-database item and then Forms won't mind if you change it.

David
Re: Do u want to save the changes [message #398369 is a reply to message #398356] Thu, 16 April 2009 02:13 Go to previous messageGo to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
If I made that non database item, then how can i update the corresponding employeecode.
Re: Do u want to save the changes [message #398592 is a reply to message #398369] Thu, 16 April 2009 20:14 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Assign the value from the displayed non-database item to the not displayed database item in the When-Validate-Item trigger of the displayed non-database item.

David
Re: Do u want to save the changes [message #398616 is a reply to message #398592] Thu, 16 April 2009 23:14 Go to previous message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
now , it's working
thank u
Previous Topic: WEB.SHOW_DOCUMENT
Next Topic: Controlling user access to menus
Goto Forum:
  


Current Time: Sat Dec 03 08:02:35 CST 2016

Total time taken to generate the page: 0.04709 seconds