This content has been marked as final. Show 11 replies
user12021655 wrote:Press on execute query icon in the icon menu.
After the 'Save' icon is pressed, I need to make the current block perform execute query. How do I accomplish that?
If you want it automatically, write Post-Insert or Post-commit trigger at form level and write
Hope this helps
Create a Timer inside ur POST-INSERT Trigger and create a WHEN-TIMER-EXPIERED Trigger Form-Level to write ur built-ins
u can use the trick of a timer in POST-UPDATE or in POST-INSERT trigger as follow...
In Form-level create WHEN-TIMER-EXPIRED Trigger use ...
DECLARE vTimer TIMER; BEGIN vTimer:=CREATE_TIMER('TEMP',10,NO_REPEAT); END;
Hope this helps...
GO_BLOCK ('BLOCK_NAME'); EXECUT_QUERY; DELETE_TIMER('TEMP');
So as per you requirement, the user will made some changes ie (updates in table) and the updated data need to reflect on the block immediately.
So you can use onetime_where clause property,i have faced this problem and its get solved by using it.
set_block_property('You_block_name',ONETIME_WHERE,'Any Primary Key Field='||:Block.Field_name);
You can also refer the user guide and check how this works.
Thanks & Regards
user12021655 wrote:If user is making any changes and pressing save than this would be the current state. What do you exactly mean by current state of base table. If user is expecting changes from any other user than can press execute query (F8) why needs save??
the current tab(block) needs to be re-queried to display the current state of the base table.
Anyways, the thing you are asking can be done by creating one trigger on form-level called KEY-COMMIT and the code as below...
It will do the execute query on the current block where the cursor exists.
user12021655 wrote:Hi user12021655
Actually there are several tab pages in my form. Each tab is based on a table/tables. So when ther user presses the save icon (or saves the changes), the current tab(block) needs to be re-queried to display the current state of the base table.
Well,now it's different solution , then we should follow this trick...
Pls create stack canvas for each tabpage on a content canvas and create stack1 for tab_page 1 and stack2 for tab_page 2 , etc.
IN BOTH WHEN-TAB-CHANGED-TRIGGER AND KEY COMMIT Trigger whatever u want to execute the query on pls use the following code as an example ;
Meaning u have customize it according 2 ur needs it's just an example to replace the name of ur tabs ,canvas names according to ur requirement applied
Hope this helps...
DECLARE V_TapPage_Name VARCHAR2(100); BEGIN SHOW_VIEW('TABCANVAS'); V_TapPage_Name :=GET_CANVAS_PROPERTY('TAB_CANVAS_NAME',TOPMOST_TAB_PAGE); IF V_TapPage_Name = 'TP_1' THEN -- For tab1 When changed Then the item should be visible and navigable in the stacked canvas which resides on the tab1 GO_ITEM('BLOCK_NAME.ITEM_NAME'); SHOW_VIEW('STACK1'); HIDE_VIEW('STACK2'); EXECUTE_QUERY; -- For tab2 When changed Then the item should be visible and navigable in the stacked canvas which resides on the tab2 ELSIF V_TapPage_Name = 'TP_2' THEN GO_ITEM('BLOCK_NAME.ITEM_NAME'); SHOW_VIEW('STACK2'); HIDE_VIEW('STACK1'); EXECUTE_QUERY; ---- and the LIKE ---- END IF; END;