Logic for EDIT button [message #641899] |
Thu, 27 August 2015 01:31 |
|
shumail
Messages: 149 Registered: September 2012 Location: Canada
|
Senior Member |
|
|
Hi
I really appreciate if some one guide me what should be the code on when button Pressed trigger for Edit purpose...
In my scenario, I have a field in which I have to enter name and if I enter some input in this field and press EDIT button then it shows data against that name and other info in separate window and allow for modification .....I appreciate if someone send me some sample code so that I can view it and change it accordingly. Thanks
|
|
|
|
|
|
|
|
|
Re: Logic for EDIT button [message #641973 is a reply to message #641947] |
Fri, 28 August 2015 09:39 |
|
CraigB
Messages: 386 Registered: August 2014 Location: Utah, USA
|
Senior Member |
|
|
Littlefoot is correct. By setting :ROLE_MAINTENACE.ROLE_NAME to the value of :ROLE_SEARCH_RESULTS.ROLE_NAME you have changed the status of the block. So, when you call Execute_Query(), Forms wants to know if you want to save the change before it clears the block and executes the query. In your example, you are going to get all of the records from the table behind the ROLE_MAINTENANCE block.
SHOW_WINDOW('ROLE');
:ROLE_MAINTENANCE.ROLE_NAME := :ROLE_SEARCH_RESULTS.ROLE_NAME;
...
This is wrong. Do you want :ROLE_SEARCH_RESULTS.ROLE_NAME to be the search criteria for the ROLE_MAINTENANCE block? If yes, then you have 2 options.
1st - Show your Window, Navigate to the ROLE_MAINTENANCE block and put the block into Query Mode. THEN assign :ROLE_MAINTENANCE.ROLE_NAME equal to :ROLE_SEARCH_RESULTS.ROLE_NAME and lastly call Execute_Query.
or
2nd, you need to set the DEFAULT_WHERE clause of your ROLE_MAINTENANCE block before you call Execute_Query. For example:
/* Option 1 */
SHOW_WINDOW('ROLE');
GO_BLOCK('ROLE_MAINTENANCE');
ENTER_QUERY;
:ROLE_MAINTENANCE.ROLE_NAME := :ROLE_SEARCH_RESULTS.ROLE_NAME;
execute_query;
/* Option 2 */
SHOW_WINDOW('ROLE');
GO_BLOCK('ROLE_MAINTENANCE');
-- Assuming you are using Forms 10g or higher...
Set_Block_Property('ROLE_MAINTENANCE', ONETIME_WHERE,'ROLE_NAME = '''||:ROLE_SEARCH_RESULTS.ROLE_NAME||''');
-- If you are NOT using Forms 10g or higher then...
Set_Block_Property('ROLE_MAINTENANCE', DEFAULT_WHERE,'ROLE_NAME = '''||:ROLE_SEARCH_RESULTS.ROLE_NAME||''');
execute_query;
The above code samples are untested and may need changes in order to work...
Craig...
[Updated on: Fri, 28 August 2015 09:40] Report message to a moderator
|
|
|
|
|