I have an interactive grid, which opens a modal dialog and passes various page items to the modal dialog.
In the Modal Dialog, I have a File Upload I am trying to use. I am aware that there likely needs to be a page submit for the file upload to work, but because I am working in a modal dialog I am saving in a Dynamic Action PL\SQL process.
I am performing a SUBMIT action early on in the dynamic action, thinking this would send everything necessary back to the session, including the file upload payload.
But the page item for the file upload P3_DES_ATTACH is always NULL.
Everything else is being passed back to session and being saved, but it always sees the FILE UPLOAD as being NULL.
Is there something about a dynamic action submit action, which means the FILE UPLOAD payload is not sent, vs a full page submit.
I had all kinds of problems trying to do a full submit on the modal dialog. Seems you cant add “P3_DES_ATTACH” in the “ITEMS TO SEND”, either in a dynamic action SUBMIT or a normal page submit.
My Dynamic Action save process is as below, the DEBUG always tells me that P3_DES_ATTACH (file upload page item) is NULL, despite a SUBMIT action taking place before it in the Dynamic Action.
I am using Apex 24.1 (on premise).
DECLARE
v_blob_content BLOB;
v_filename VARCHAR2(1000);
v_mime_type VARCHAR2(1000);
v_last_updated DATE;
BEGIN
APEX_DEBUG_MESSAGE.ENABLE_DEBUG_MESSAGES(p_level => 3);
UPDATE T_LP_DAILY_RECONCILIATION
SET des_receipt_confirmed = :P3_DES_RECEIPT_CONFIRMED,
des_receipt_confirmed_date = COALESCE(TO_DATE(:P3_DES_RECEIPT_CONFIRMED_DATE,'DD-MON-YYYY'), sysdate),
des_receipt_confirmed_by_prid = :APP_USER,
des_receipt_confirmed_by_name = (SELECT DISPLAY_NAME FROM FN_GET_PEOPLE_API_BY_PRID(:APP_USER)),
des_receipt_confirmed_by_email = (SELECT EMAIL FROM FN_GET_PEOPLE_API_BY_PRID(:APP_USER)),
des_comments = :P3_DES_COMMENTS,
des_last_modified_date = sysdate,
des_last_modified_by_prid = :APP_USER,
des_last_modified_by_name = (SELECT DISPLAY_NAME FROM FN_GET_PEOPLE_API_BY_PRID(:APP_USER)),
des_last_modified_by_email = (SELECT EMAIL FROM FN_GET_PEOPLE_API_BY_PRID(:APP_USER)),
des_follow_up_sent = :P3_DES_FOLLOW_UP_SENT,
des_follow_up_date = COALESCE(TO_DATE(:P3_DES_FOLLOW_UP_DATE,'DD-MON-YYYY'), NULL)
WHERE ID = :P3_ID;
APEX_DEBUG_MESSAGE.LOG_MESSAGE(
p_message => '[*] P3_ID = ' || :P3_ID,
p_level => 1 );
APEX_DEBUG_MESSAGE.LOG_MESSAGE(
p_message => '[*] P3_DES_RECEIPT_CONFIRMED = ' || :P3_DES_RECEIPT_CONFIRMED,
p_level => 1 );
APEX_DEBUG_MESSAGE.LOG_MESSAGE(
p_message => '[*] P3_DES_RECEIPT_CONFIRMED_DATE = ' || :P3_DES_RECEIPT_CONFIRMED_DATE,
p_level => 1 );
APEX_DEBUG_MESSAGE.LOG_MESSAGE(
p_message => '[*] P3_DES_FOLLOW_UP_SENT = ' || :P3_DES_FOLLOW_UP_SENT,
p_level => 1 );
APEX_DEBUG_MESSAGE.LOG_MESSAGE(
p_message => '[*] P3_DES_FOLLOW_UP_DATE = ' || :P3_DES_FOLLOW_UP_DATE,
p_level => 1 );
APEX_DEBUG_MESSAGE.LOG_MESSAGE(
p_message => '[*] P3_DES_COMMENTS = ' || :P3_DES_COMMENTS,
p_level => 1 );
IF :P3_DES_ATTACH IS NOT NULL THEN
APEX_DEBUG_MESSAGE.LOG_MESSAGE(
p_message => '[*] P3_DES_ATTACH IS NOT NULL',
p_level => 1 );
select blob_content, filename, mime_type, created_on
into v_blob_content, v_filename, v_mime_type, v_last_updated
from apex_application_temp_files
where name = :P3_DES_ATTACH;
APEX_DEBUG_MESSAGE.LOG_MESSAGE(
p_message => '[*] P3_DES_ATTACH NAME = ' || :P3_DES_ATTACH,
p_level => 1 );
UPDATE T_LP_DAILY_RECONCILIATION
SET DES_FILE_NAME = v_filename,
DES_FILE_MIME_TYPE = v_mime_type,
DES_FILE_BLOB = v_blob_content,
DES_FILE_LAST_UPDATED_DATE = v_last_updated
WHERE ID = :P3_ID;
ELSE
APEX_DEBUG_MESSAGE.LOG_MESSAGE(
p_message => '[*] P3_DES_ATTACH IS IN FACT NULL',
p_level => 1 );
END IF;
END
Regards
Stephen M