Apex 18.1 How to create Multi Column LOV to Return multiple values in multiple columns separately - oracle

using Oracle Apex 18.1 and want to have multi-column LOV and return multiple values in columns separately like this will return Department_Id and Manager_Id values in my page items Department_Id and Manager_Id separately.

Well, that's not how Apex LoV works. It must have exactly two values: display and return. Display is what you see, Return is what is actually "stored" into the column. One column, not two (or more) of them.
That's unlike Oracle Forms, which lets you create a LoV that contains many columns and map those values to different form items.
So, what you could try is to use a "Set value" dynamic action and - once you fetch the return value into the item, populate other items on the page.

The way I deal with this is either two LOVs that are parent child.
Set an LOV for departments, and have the second LOV with Managers which takes the department you have as a parameter.
Or I set it up like
SELECT department || ' ' || manager as d
, manager as r
FROM database
And then set up something to fill the department based on the manager chosen.
This assumes the manager is in only one department. I guess you might be able to populate a list with managers who are in multiple departments and then return the PK of the table, and use that return to save into your table.

This might be what you are looking for. Otherwise you might have to make your own.

Related

session item does not change when using lov in primary key

I am implementing a Interactive grid to perform DML operations on a table.
it has combined primary key of two columns
One primary key column is display only and refer to master table and another primary key column I want to have a LOV to select value. LOV is dynamic lov having a display and return value picked from another table.
Inserts are fine but session state item value is set for one row and all the operations are performed on that same row irrespective of which row is selected.
you can see a sample here
https://apex.oracle.com/pls/apex/f?p=128616:2:1964277347439::NO:::
master table name: sample
detail table name: sample_child
primary key in sample child : ID and Name
pop lov is implemented in NAME
LOV values are picked from table: Sample_uncle
LOV display : ID || '-' || NAME
LOV return : ID
you can try to update blabla column of sample_child table to see the issue.
I am not sure how I can give you access to look at the implementation.
I have already tried all the options I can think of
This is to do with your primary keys, the detail table does not appear to have proper ones, thats why it always tried to update the first entry, and I think this is also why every row is marked when you load the table.
Primary keys also do the annoying thing of refusing to be empty, as you can see if you insert a new row, the middle column(which is a PK) is filled with 't1001'.
Since you are dealing with simple tables(and not a whole bunch of joined tables) I always consider it best to use ROWID as PK. So set ROWID as PK for the master table, and ROWID for the detail table. And have the detail table have a Master table be your master table, and then click on the first column in the detail table and set the master column for it. And I also personaly always hide the column that is linked.
I would advise you use ROWID whenever possible as its just so much easier to work with, it does mean you might need to set up a validation to prevent someone adding duplicated values for your actual PK, but since the PK is in the underlying table, they cant enter it anyways(but if you have a validation, the error will be much prettier), whilst if the column is a PK, APEX will prevent duplicates by default.
I hope this helps

Oracle apex report View

Can I create a report like the below screenshot?
This is being a challenge to create cascaded column like some columns will be grouped into specific parent column.
You can try pivoting the interactive report ([Actions]->[Format]->[Pivot]) with two columns as Pivot columns.
It will group Parent and Child columns like in the example.
The limitation is to show only numeric data though.

dependent Lov in oracle forms 10g

I have database block table columns , that has no values means not inserted any values , i have 2 columns in that block order_no,order_name , table name called xx_customer_details, so i need to create LOV on order_no column using oracle table customer_details ,my requirement is i am selecting Order_no vlaues from LOV then need to populate in the order_name column automatically
Thanks
For this, you simply create a RECORD GROUP with the required columns
select order_no,order_name from xx_customer_details;
Now create LOV and assign this record group to it.
In your LOV properties you find Column Mapping properties and map the columns accordingly.
And finally assign this LOV to your text item.
Then you are done.

How to bind multiple tables to single DM form?

I have a DM Form type page, where I would like to show and update values from different tables. By default when I created page, I have been asked for data source, specified only one of the tables, which in fact created process in After Header of type Automated Row Fetch. Also in After Submit a process of type Automatic Row Processing (DML) is created. When I add an item in the page from different table, obviously I am getting an error that the column not found in that table. How can I add more tables into that page, so they will be fetched and updated properly?
There is a common column in all tables, to identify which record I would like to show from each table.
I would like to show and update values from different tables
[...]
There is a common column in all tables, to identify which record I would like to show from each table.
Maybe are you looking for a simple JOIN on your various tables?
Based on Oracle's HR example schema, if you need to display both departments and employees names, you write something like that as your report query:
SELECT department_name as dep_name,
first_name || ' ' || last_name as emp_name
FROM HR.DEPARTMENTS JOIN HR.EMPLOYEES
USING(DEPARTMENT_ID)
In order for this to be usable from APEX form builder, you have to wrap it in a VIEW:
CREATE VIEWS MY_VIEW AS SELECT .... FROM ... JOIN ...
I can't guarantee that the view will be update-able out-of-the-box as Oracle has very specific rules for inherently updatable views -- especially for join views. However, you might be able to make your view updatable anyway by using an INSTEAD OF trigger. If you decide to go that way, maybe worth considering asking an other question on that specific topic if needed.

Oracle Apex - Optional List of Values (LOV)

Is there a way in Oracle APEX to use a list of values or select list but do not force the user to select an item and allow them to enter different items?
The basic functionality which I require is similar to a combo box where you can optionally select an item from the list or enter a completely new.
Thanks Mark
Yes:
you could use a Popup LOV item type, where the user can type anything they want, and the LOV is only used to give them suggestions if they click the LOV button.
you could use a Select List, and set Display Null = Yes; but then the user cannot enter their own values.
You could use a Popup LOV and UNION it with the values already entered into the target table. It would be slower and ordering would be more constrained.
For large tables you could have a process that compared the distinct set of values in the target table with those in the lookup table and entered new ones into the lookups table.

Resources