oracle apex change value of textfield automatically

Viewed 381

In oracle apex, i have two textflelds, one is for client id, and other is for client name.

I want that when I put the client id , client name's textfield should show the value automatically by fetching from the table.

i have tried it by using function, but failed

create or replace function clientname_byid(c_id in number)
return varchar2
is
cname varchar2(25);
begin
select client_name into cname from client_data where client_id = c_id;
return cname;
end;

and call this function in the clientname textfield by

select clientname_byid(:P2_CLIENT_ID) from dual;
1 Answers
  • Create a "Set value" dynamic action on P2_CLIENT_ID item.
  • Use SELECT statement you wrote above, slightly modified:

    select client_name from client_data where client_id = :P2_CLIENT_ID;
    
  • Don't forget to set dynamic action's "Items to submit" to P2_CLIENT_ID, otherwise it won't work.

Related