Change to display field on control block not reflected until form refreshed
398120Aug 10 2009 — edited Aug 17 2009Hi guys, hope someone out there can help me with this query.
I'm currently developing a form that will allow users to generate offer letters and contracts via a custom form which is used within Apps 11i. This form is a fairly standard multi-text field form with tickboxes which hold the applicant details, two buttons (one to Select All, the other to Clear All) and another button to produce the actual contracts selected.
There is also a display field which is part of the control block attached to the form; both it and the Produce Contracts button are part of this control block. I've added a bit of code to change the text in the display field to inform the user that the contract or contracts they've requested are being generated, but although the call to the relevant code to do this appears before kicking off the concurrent request to generate the contracts, the update to the field fails to appear until after the concurrent request is complete and its output appears on another screen.
Does anyone know why this is? I've racked my brains over it and can't seem to understand why. I've pasted the code in below if anyone has any ideas!
Many thanks, Geoff
-----------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------
--- procedure display_status_message ---
--- Displays a status message in the request_extract_ctrl.query_information ---
--- display item informing user what is going on ---
--- Changes: ---
--- G Butler 21/08/08 First version ---
----------------------------------------------------------------------------------
procedure display_status_message(p_tab_count in binary_integer default 0) as
c_proc_name constant varchar2(50) := 'display_status_message';
v_position pls_integer;
v_msg_string varchar2(500);
v_status_msg varchar2(2000);
begin
v_position := 1;
--- go to the request_extract_ctrl block
go_block('REQUEST_EXTRACT_CTRL');
--- check how many records have been sent for generation
--- get the correct message from the message dictionary
if p_tab_count = 1 then
fnd_message.set_name('XXJSDATA','SSL_CA_LETTER_CONTRACT_SUBMIT');
elsif p_tab_count > 1 then
fnd_message.set_name('XXJSDATA','SSL_CA_LETTER_CONTRACTS_SUBMIT');
end if;
v_position := 2;
--- copy the message into the display item field
v_status_msg := fnd_message.get;
:request_extract_ctrl.query_information := v_status_msg;
-- synchronize the change in the display item field with the form on screen
synchronize;
v_position := 99;
exception
when others then
v_msg_string :='Unexpected error occurred in display_status_message procedure, position: '||v_position;
v_msg_string := v_msg_string||'. SQL error: '||sqlerrm;
fnd_message.set_string(v_msg_string);
fnd_message.error;
raise form_trigger_failure;
end display_status_message;