Main menu

Post navigation

How to test an On-Demand Process used for AJAX

You have created an On-Demand Process to do an AJAX call from JavaScript, like Carl Backstrom showed it in an example, but the On-Demand Process doesn’t return anything.

What’s wrong?

There can be multiple causes what can be wrong with an On-Demand Process. When you read the documentation you will notice that

Any failures of authentication, authorization, or process conditions do not result in visible error messages or other indicators of such failures and most often result in a blank page being displayed.

This also includes errors when the PL/SQL code of your On-Demand Process doesn’t compile or when you specify a wrong process name. This is because of security concerns as Scott Spadafore confirmed in a recent posting.

So what to do if APEX doesn’t tell us anything?

You first have to figure out where the problem of your On-Demand Process is.

Has a wrong process name be specified?

Does it raise an exception which causes a blank page?

Does the PL/SQL code not compile?

The best way to test it is to start the On-Demand Process directly through the proper URL. It’s much easier than calling it from some JavaScript code where you don’t see what is returned.

Hi you have a very good block.
You know i have a very probleme
i want to insert in my table by usin process on demand
in first time it work but if i use insert field blob ,the process can’t insert this field why
the source of process:
declare
dd number;
dd1 number;

begin
IF (:P10_PHOTO IS NOT NULL) THEN
insert into voiture
(MAT,MARQUE,COULEUR,NB_CHEVEAUX,TYPE_VOIT,DESCRIPTION,N_VIGNETTE,
N_ASSURANCE,EMPLACEMENT,PRIX_VOIT,COMPTEUR_VOIT,N_CARTE_GRISE,PHOTO)
select
:P10_MAT,:P10_MARQUE,:P10_COULEUR,:P10_NB_CHEVEAUX,:P10_TYPE_VOIT,
:P10_DESCRIPTION,:N_VIGNETTE2,:N_ASSURANCE2,:P10_EMPLACEMENT,
:P10_PRIX_VOIT,:P10_COMPTEUR_VOIT,:N_CARTE_GRISE,BLOB_CONTENT
from APEX_APPLICATION_FILES
where name = :P10_PHOTO;
htp.p(dd1);
htp.p(:P10_PHOTO);
end if;
select max(ind1) into dd1 from voiture;

Hi you have a very good block.
You know i have a very probleme
i want to insert in my table by usin process on demand
in first time it work but if i use insert field blob ,the process can’t insert this field why
the source of process:
declare
dd number;
dd1 number;

begin
IF (:P10_PHOTO IS NOT NULL) THEN
insert into voiture
(MAT,MARQUE,COULEUR,NB_CHEVEAUX,TYPE_VOIT,DESCRIPTION,N_VIGNETTE,
N_ASSURANCE,EMPLACEMENT,PRIX_VOIT,COMPTEUR_VOIT,N_CARTE_GRISE,PHOTO)
select
10_MAT,:P10_MARQUE,:P10_COULEUR,:P10_NB_CHEVEAUX,:P10_TYPE_VOIT,
10_DESCRIPTION,:N_VIGNETTE2,:N_ASSURANCE2,:P10_EMPLACEMENT,
10_PRIX_VOIT,:P10_COMPTEUR_VOIT,:N_CARTE_GRISE,BLOB_CONTENT
from APEX_APPLICATION_FILES
where name = 10_PHOTO;
htp.p(dd1);
htp.p(:P10_PHOTO);
end if;
select max(ind1) into dd1 from voiture;