Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

The applay post-next-record method on Oracle Apex as Oracle Forms events that result in getting data without reloading page

Malek Al-Edresi2 days ago

How can I emulate Oracle Forms’ POST-NEXT-RECORD behavior in Oracle APEX so that changing an item triggers a database lookup and fills other items without a page submit or reload?

Specifically, I want a Dynamic Action on the Change event of :TESTID that runs a PL/SQL block to fetch the test price and its discount from MEDICAL_CENTER_SYSTEM.LAB_SEC_L_TESTS and then assigns them to two items on the same record/row (no page refresh). Here is the PL/SQL I want to execute:

DECLARE
    v_price     NUMBER;
    v_discount  NUMBER;
BEGIN
    SELECT PRICE, DISCOUNT_TEST
      INTO v_price, v_discount
      FROM MEDICAL_CENTER_SYSTEM.LAB_SEC_L_TESTS 
     WHERE TESTID = :TESTID;

    -- set values in the same row
    :PRICE_TEST_CONST := v_price;
    :DISCOUNTS        := v_discount;
	
	-- or set values by use set_session_state 
	apex_util.set_session_state('PRICE_TEST_CONST', v_price);
    apex_util.set_session_state('DISCOUNTS', v_discount);
EXCEPTION
    WHEN NO_DATA_FOUND THEN
        :PRICE_TEST_CONST := NULL;
        :DISCOUNTS        := NULL;
END;

Comments
Post Details
Added 2 days ago
2 comments
67 views