Oracle Apex - Optional List of Values (LOV) - oracle

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.

Related

How To Generate A Unique ID On A Field In Oracle Apex When Tab/Enter Button Is Pressed?

I am trying to generate a unique ID on Oracle Apex Forms field while Enter/Tab button is pressed like we do in Oracle Forms using the Key-Next-Item And Post-Change triggers on a field.
This is not Forms, this is Apex.
Basically, you shouldn't allow users to modify such an item (keep it hidden or display only).
In Apex, we usually create a process which sets the primary key item's value, such as
:P1_PK_ITEM := NVL(:P1_PK_ITEM, sequence_name.nextval);
Or, set that item's default value to fetch sequence's next value.
Or, create a database trigger which will populate column value before insert.
Or, if your database version is high enough (12c and later), create an identity column.

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

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.

defining a unique key column in apex

I am trying to get the distinct records from a table, as many duplicate rows are coming from the following query
select * from sales_details_view;
When I query the following query in pl/sql developer, I am getting correct results
select distinct * from sales_details_view;
But when I use the same query in an interactive report in Oracle APEX 4.1, it is giving me the following error
The report query needs a unique key to identify each row. The supplied
key cannot be used for this query. Please edit the report attributes
to define a unique key column. ORA-01446: cannot select ROWID from, or
sample, a view with DISTINCT, GROUP BY, etc.
You need to set Link Column (in Report Attributes) to something other than "Link to Single Row View". You can set it to either "Exclude Link Column" or "Link to Custom Target".

Multi-column search in lov of oracle forms developer 6i

I have created a LOV using query; It has 3 columns. When LOV is displayed I want to search a value. But when I type something it search only first column. LOV do not search in other columns except first column.
Is there anybody who knows how to search any value of other column or multi-column search in forms developer 6i?
Thanks.
An Oracle Forms LOV only searches the first column - so you might need to concatenate 2 or more columns into the first column to get what you want.
Otherwise, you may need to make your own custom LOV form.

how to hide an external table when there is no data in internal table in BIRT?

I have two tables one inside the other. When there are no detail rows in the inner table i am making it invisible. but i am not able to make the external table invisible.
In detail My inner table heading row and footer is visible even when there are no detail rows so i made the table visibility to true when no detail rows. But i am not able to make the external table invisible with the same logic. it is because even though the inner table is invisible the detail and footer is there so when i say no detail rows no visibility it is not working. so how can i hide the external table when the internal table is invisible?
I would try Binding the data set to the external table and making an aggregation that counts the number of rows in the data set.
Click on the Table
go to Binding in the Property Editor
click Add Aggregation
I called the Column Binding Name RowCount and set the Function to COUNT. Set the Expression to one of the columns from your dataset that you have included in the binding. In my case, I set Expression to row["columnname"].
Click on your table.
go to Visibility in the Property Editor.
check Hide Element and set the Expression to:
row["RowCount"]==0 || row["RowCount"]==null
The element will only display when the RowCount aggregation counts more than 1 row in your dataset.
My solution for this was to create a function that counts the records that meet the desired criterion, in my case select count(*) from my_table where user_id = id.
Then I inserted this function as a detail component that gets the count based on the selected table record.
Then I used the result of the count as a visibility rule. count > 0. this way I can hide the tables that return empty.
Using this trick is possible to hide the secondary table but the count details component will be still there, if you want to hide it you have to put it in a flexbox component. then in the visibility rules you an access you flexbox component and include the rule count > 0

Resources