APEX: Form on a Procedure

Hi!

You have a procedure.

And you want to prepare an interface for enduser so they could execute it by themselves.

however, your procedure is expecting some input parameters which are not so-easy for the users to get..

Let ‘s go with an example:

form_on_a_proc_1

example

Say this procedure is taking an account number and generating a risk report for that customer.

So you decided to publish a form on one of your APEX user dashboards:

form_on_a_proc
Building form on a procedure

After a few easy steps with this wizard, you ‘ll have your form with a field (i.e. :p_acc)on it prompting you to enter an account number

Although it works just fine, it is not that easy for users to know which company has which number. It would be way easier if they could go with company name for instance..

If you have no chance to touch to that procedure, means you can ‘t modify it to make it work with another parameter instead of v_acc (account number), you still can do something similar.

i. Create a Page Item on your page region

ii. Display as: Text with autocomplete

iii. Give your new page item a unique name (i.e. :p_cust_name)

iv. Adjust the population logic of your text field to make auto-complete thing work.

v. Then take a look at execution statement which runs your SP. You can see it by double-clicking Run Stored Procedure

form_on_a_proc_2

vi. You ‘ll see something like this

#OWNER#.basitmis_proc(V_ACC => :p_acc);

vii. Now let ‘s modify it so it could work with our other parameter :p_cust_name

form_on_a_proc_3

Let ‘s see what we did here:

 

i.We declared another variable p_cust

ii.Use it to collect account number. To know which customer ‘s account should return, we used our Page Item p_cust_name and remember, this information was provided by user.

iii.Then we bind it to our SP

**

Now your users can type ABC to automatically get ABC Company in the company name field, then click the button that triggers your execution process. Your little declaration above will do the rest :)

Tschau!

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s