Apex Collections, an example (part 2)

Here is the second part about collections, my problem could be described as:
we would like to let users add order lines to an order, update and delete them without saving anything in our database until the user confirms that the order is correct and wants to create it.


1.4 Add Member to Collection
We can now create a process that will add members to our collection and link this process to our ‘Add Row’ button.

1.5 Update Collection
Now that we can add rows to our collection, it’s time to update it. With ‘wwv_flow_collection.update_member_attribute’ we can update our collection. We must specify the collection name, seq_id, the column and its value. Create the process without any condition.

1.6 Delete Collection
Finally we can make sure that users can delete members from the collection. We will use the checkbox for this. Create a process that will be executed when the delete row button is pressed. Use ‘wwv_flow_collection.delete_members’ to delete a member from your collection. We must specify our collection name, the column where we are looking for and then the value for that column.
We will use our key value in p_c001 to delete members from our collection.

1.7 Save Results
Last but not least, we can store the members from our collection to the right table. I use a database procedure for this:
INSERT INTO order_lines (order_line_id,
order_id,
description,
amount,
line_nr)
SELECT c001,
p_invoice_id,
c002,
c003,
seq_id
FROM wwv_flow_collections
WHERE collection_name = ‘ORDERS';

1.8 Summarize
Page 1:

(note: processes are conditional with a request so the user can browse back to page 1 without deleting his collection)

Page 2:

About these ads

One thought on “

  1. I have a problem updating my collection with the input values of my report columns. The main issue I am struggling with is the p_attr_value. As I can understand this value should ref. the updatable columns in the rows of the report. g_f01(rowCount) representing the first column and g_f02(rowCount) rep. the second column and so on…What I don’t know is the variable that precedes this, in your example it’s Apex_Application.g_f01(rowCount) and in the Oracle example it’s wwv_flow.g_f01(rowCount) but neither explains what actually it is?? I’ve tried both in my example but neither works..Can you help?Many thanks,Desperate Dan.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s