In this article we are going to explain how to implement Auto refresh functionality inside SRS screen for Oracle E-Business Suite R11,R12 just like standard function implemented into SRS screen in newest version of Oracle E-Business Suite R12.2.6.
Basically you will reduce the number of mouse clicks and [alt+r] on each request. I just want to help others to be more relaxed, I hope so.
Let’s get started:
- First step is to download SRS form called (FNDRSRUN.fmb) from $AU_TOP to your local machine and open it with oracle forms builder to modify it.
- Second we’ll create a Control block with name (CTRL_BLK_REFR) and then add two items on that control block we created recently then assign the properties of these items as follows:
- Item 1 :
- Name: AUT_REFR
- Item type: Check Box
- Subclass information: CHECKBOX
- Label: Auto Refresh (&B)
- Value when Checked: 1
- Value when Unchecked: 0
- Check Box Mapping of Other Values: Unchecked
- Maximum length: 1
- Initial value: 0
- Database Item: No
- Canvas : JOBS
- Height: 0.2
- Item 2:
- Name: REF_INTERVAL
- Item type: Text Item
- Subclass information: TEXT_ITEM
- Initial value: 5
- Lowest Allowed Value: 1
- Highest Allowed Value: 30
- Database Item: No
- Maximum length: 2
- Canvas : JOBS
- Height: 0.2
Observing CANVAS value of two items, we created inside control block but we’ll display them on JOBS Canvas.
- Third step is after add this item’s into the Block, justify them into a proper location inside your canvas something like this:
- Forth step is to add this code to trigger (WHN-NEW-FORM-INSTANCE).
Declare
--
v_timer TIMER;
--
Begin
--
:CTRL_BLK_REFR.REF_INTERVAL := 5;
v_timer := Create_Timer('AUTREFTIMER', : CTRL_BLK_REFR.REF_INTERVAL * 1000 , REPEAT);
--
End;
- This code basically to create timer.
- Fifth step is to add new trigger (WHEN-TIMER-EXPIRED) on form level and put this code inside:
Declare
--
v_timer TIMER;
--
Begin
--
v_timer := Find_Timer('AUTREFTIMER');
--
IF NOT ID_NULL(v_timer) THEN
--
IF (:CTRL_BLK_REFR.AUT_REFR = 1) THEN
--
Go_item('JOBS.REFRESH');
Execute_trigger('WHEN-BUTTON-PRESSED');
--
END IF;
--
END IF;
--
End;
- Here we go to standard button (Refresh) and execute its trigger to do its job after timer expired and at that time for initial value of the (REF_INTERVAL) item is 5 seconds.
- Now this the last step of extending this form, just we need to add new (WHEN-VALIDATE-ITEM) TRIGGER on item (REF_INTERVAL) to handle the timer with new value of seconds entered in this item to refresh the concurrent based on that value. You to put this code:
Declare
--
v_timer TIMER;
--
begin
--
v_timer := Find_Timer('AUTREFTIMER');
--
--
IF NOT ID_NULL(v_timer) THEN
--
Delete_Timer('AUTREFTIMER');
--
END IF;
--
--
v_timer := Create_Timer('AUTREFTIMER', NVL(:CTRL_BLK_REFR.REF_INTERVAL,5) *1000, REPEAT);
--
end;
Now we are finished from extending SRS form and add new small feature that will save your nerves.
Just move the FMB to the server and compile it into $FND_TOP.
- For best practices you should mark this form as changed flag from (Applications Manager) to save your changes from any patch will apply and affect this form.
Note: We are not responsible about production issue’s that may happen because of wrong implementation of this functionality. So please be careful and try it first in test instance to make sure 100% its working fine as you see in the picture below:
Here you can find PDF Document for this article in case you want to save:
———-
That’s it.
Hope this helpful.
if you have any suggestions to improve this functions, please share it with others also don’t let this post stop at your computer.
Hi I performed the changes, but now the Refresh Data/ Auto refresh gives error: This query is not allowed because it would return all rows. Please enter some criteria to reduce the rows that will be returned.
hello Abhishek,
which query exactly return error ? and be sure that you add new item in the proper place like i mentioned in the tutorial.
thanks
Hi
very interesting, is it possible to implement this option in 12.1.3 ?
Thanks.
Regards;
Hello Omar,
Yes it is, actually this article applied on R12.1.3 version and it’s applicable till version that has this feature R12.2.6.
so i hope you find this helpful.
jamal.awad.eid..economic.
very helpful I will test it. 🙂
Thanks albert
its so nice explain.
thanks oracle user