How to only make certain columns editable in a table in APEX ORACLE - oracle

I'm trying to make a interactive grid that allows users to update certain tables depending on the permission/privilege they have. Currently, there is an updatable table in APEX, but it allows for the user to edit every column. Is there a way to not allow the user to edit certain columns in APEX ORACLE? Thanks

Two simple options I can think of: navigate to column's properties and
set item type to "Display only", or
scroll down as set it to be "Read only" and specify some condition (the most obvious one is "Always")

You just need to go to Columns , expand, select the column that you want and set it to Display Only.

Wanted to post an answer here in case somebody else was looking for what I was when I found this.
If you want to make sure users can not change some columns but they can change others and that they can still add new rows.
You need to set each row you want to make not editable to read only when item is not null, type in the name of the row into the Item query and then also check that you want to do this for each row.

Related

Can :xdo_user_name be used in list of value in Oracle bi publisher? Or just works in data set

I am making a data mode. Involve a list of values to bind with parameter. Just want to ask if adding :xdo_user_name as the list of value sql parameter is possible?
I am hoping that user login, the menu will only show related data to him.
Many thanks.
Not sure if this can work or not.
You could create a List Of Values - Type SQL Query
select :xdo_user_name as USER_ID from dual
Now create new parameter of (parameter) type Menu and based on the above LOV. Next, in your datamodel you can use the newly created parameter any way you need.

Form WHERE clause

I have an APEX form I'm developing for "user settings". I have a table with a sequence as a primary key and the users ID in another column...in addition to a few columns where each users saved settings are stored (things like "N" for do not receive notices).
I haven't used Oracle APEX in a while so excuse this likely newbie question...The insert works fine, but I'm having trouble with making the form only show the current users values. In my Form Region the source is set to my Table, and I have a WHERE clause like this:
USER_ID = 813309
But that's not working (813309 is my id and I'm just hard-coding it for now). The form always comes up with a "New" record.
For a form to load a specific record you can set the primary key page item to the value you need. You can do so in the url using the link builder from another page or you can set a computation on the item. That is what I would try in your case: add a computation to your item P_USER_ID of type "Static Value" with value 813309. Make sure the computation happens before the "Fetch Row" - the value obviously needs to be set before the process runs.
In such cases, I prefer creating a Report + Form combination (using the Wizard, of course): it creates an interactive report (so that you can review data in a table), and a form which is used to add new records or update/delete existing ones.
Doing so, when you pick a user in interactive report and click the icon at the beginning of a row, Apex redirects you to the form page, passing primary key column value to the form which then fetches appropriate data from the table.
Not that it won't work the way you're trying to do it, it's just simpler if you let Apex do everything for you.
So: did you create an automatic row fetch pre-rendering process? If not, do so because - without it - Apex doesn't know what to fetch. Also, if you hardcoded user_id, it won't do much good. Consider storing username into the table so that you could reference it via :APP_USER Apex variable.

What determines default Interactive Report column layout in Oracle APEX 5?

I have an Interact Report page in Oracle APEX 5 that includes a SQL Query with ~10 columns or so. When I first load the report, the columns are in a certain order, and columns are set to Do Not Display (as seen under Actions -> Select Columns). The default order does not seem to match the order in which I list them in the SQL Query, nor does it use the order that is found in the Page Designer, under {Page Name} -> Regions -> Content Body -> {Interactive Report} -> Columns. I have two questions about the way columns are displayed in the Interact Report component:
What determines the default order of these columns?
What determines which columns are set to Do Not Display and those set to Display in Report?
Are those settings saved for each user?
First of all, you should probably take a good look at the documentation. Plenty of useful things. The main thing you're looking for in this case would be about saving interactive reports.
In short though.
When first having created the IR the columns will be in the same order as in the select statement.
Afterwards, there is no longer a relation between position in the select statement or the order of the columns as seen in page designer.
Instead, the initial order has been used to create an initial Primary Default report.
From this point on, column position and being hidden or display solely depends on the settings in the "Select Columns" menu.
If you want to alter the default offered to the end user, you'll have to run the page, alter the IR, and save your settings through Actions > Save Report and selecting Primary Default.
Settings saved for each user? Yes and no. End users will be offered the primary default at first. If multiple defaults are present the application will remember which one they have last been working on when coming back.
Users can also save private versions of reports, or public ones, if enabled. They can then edit the report settings, but these settings only affect their own report in that same session. If not saved, all changes they made settings-wise are lost and they'll be presented with the defaults again next time they log in. (or perform a reset themselves).
Unless you take all control away of course, by configuring the Actions menu of the IR.
I was hoping to edit saved reports in the Application Builder, but I guess this is not available (at least in 5.1 that I'm using).
This helped me:
SELECT FLOW_ID, PAGE_ID, REPORT_ALIAS, STATUS, IS_DEFAULT, DISPLAY_ROWS, REPORT_COLUMNS
FROM apex_050100.WWV_FLOW_WORKSHEET_RPTS
WHERE FLOW_ID = 101
AND page_id = 25
;
Then I edited that table updating columns list or other attributes of the saved report.

Oracle forms hybrid validation

This is my first post ever and haven't come across any other questions related to this. I am attempting to try and create a hybrid validation type and add it to an existing oracle form. We have a super/subset type of thing going on. When one chooses something from a dropdown, there are 5 options. If 4 of those options are chosen, the data is pulled from one validation table dataset, table A. If the other option is chosen, it comes from a different table's dataset, table B. These (along with others items) are saved in Table C. Table C has a FK constraint regarding these validations. I have added another column to table C to attempt to bypass the FK constraint, but the field still tries to save in the FK column. I can't seem to figure out if I need to add a database trigger, an item level trigger, or a form level trigger to reroute the data to correct columns in the database. Thanks in advance for any help!
If your items are select lists, you would use an item level trigger (when-validate-item) on the superset list item to populate/repopulate the list for the subset item.
Alternatively, you could use a popup LOV on the subset item which has a query which is filtered by the value of the superset item.

FileMaker Pro -- Filtering Relationship Not Working

I'm trying to build a FileMaker Pro 11 layout that excludes records containing a certain value. The relevant data is in table Invoice. I want to filter so that Invoice records whose "Invoice Check Grouping" field is blank are not displayed on the layout.
I've added a global field to the invoice table called "Blank Invoice Check Grouping" to use as my filter criteria. I've created a self-join relationship to the Invoice table, joining "Invoice ID" to "Invoice ID" and joining "Invoice Check Grouping" to "Blank Invoice Check Grouping". The resulting table is named "Invoice Check Groupings".
The layout which I build based on table "Invoice Check Groupings" shows all records in Invoice--it does not filter out those with blank values. What am I doing incorrectly?
Thanks,
Ben
Layouts show records in a table (or more accurately, a table occurrence) and don't directly deal with related data. As mentioned by #pft221, you can use relationships for filtering, but only when viewing data through a portal.
If you always want a particular layout to show data based on a particular find, you can do so with a script and a script trigger. First set up a script to do the following:
Enter Find Mode[]
Set Field["Invoice Check Grouping"; "*" // Find all records with any data in this field
Perform Find[]
Note that you can also embed the find request within the Perform Find script step, but I tend to script finds in the above manner as it's easier to see what the find request is in the script and variables can be used in the find request.
Now you need to set your layout to execute this script whenever it's loaded. Go to the layout and enter Layout Mode. Select Layouts>Layout Setup from the menu bar. Click the Script Triggers tab and check the box for OnLayoutEnter and select the script you wrote above. Now whenever the layout is entered, that script will run and exclude the records that have that particular field being empty.
There are many ways to filter records, depending on what you are trying to do and what you are trying to display for your users.
The most common and simple way you can filter records is through a simple Find in a list view. I'm unclear from your question, but my best guess is that you're already using a list view and misunderstanding how FileMaker's relationships and Table Occurrences (TO's) work.
To Filter with the "Find Records" method:
Create a new List View layout of any Table Occurrence of your Invoice Table -- most likely you will want to use the default Table Occurrence that FileMaker created for you when you created the table.
Place the fields that you would like to display on that layout, including the "Invoice Check Grouping" field.
Switch into Find Mode
Put a '*' character into the "Invoice Check Grouping" field
Perform the Find
You should now see a list of all Invoices where the "Invoice Check Grouping" field is not blank. (You can find additional interesting search criteria in the "Insert: Operators" drop down of the title bar.)
Now you may actually be looking to filter related records through a portal but, given that you've set up a self-join on the Invoice index on the Invoice table my guess is that, at best, this would show either 0 or 1 record for each Invoice record you display in your main layout.
To Filter Records with the "Portal Filter" method:
Let's assume, though, that you have a Client table where you'd like to see only the records with a non-blank "Invoice Check Grouping" value. The table set-up would be as follows:
Client
Client ID
[... other client info ...]
Invoice
Invoice ID
Client ID
Invoice Check Grouping
[... other invoice info ...]
With a relationship in the relationships graph:
Client::Client ID ------< Invoice::Client ID
From there you would set up a Form layout on the Client TO and create a portal showing records from the Invoice TO. From the options for the portal you would select "Filter Portal Records" and use a formula similar to:
not IsEmpty(Invoice::Invoice Check Grouping)
Finally, it's worth noting that a portal filter isn't appropriate for all display situations or calculations. You can set up a similar filter completely through your relationships graph (as I believe you have already tried to do.) This will work, once again, for viewing records through a portal but not for the records displayed by a layout itself.
The answers above don't actually help Ben with his question. They are workarounds.
I have the same problem as Ben, and I don't think there is a solution, even now in Filemaker 12. There is I think no way to define a relationship that will omit the related records where the match fields are empty.
Two options come to mind:
On a specific layout, you have more fine-grained control in the portal definition itself, and can use this to exclude the records
You can now use SQL queries to achieve this result within Filemkaer.

Resources