Oracle Application Express - Form Fields not Populated with Data - oracle

By default, when creating an application with Report + Form pages, you would get something like this (and I initially did):
Report Page
Form Page (when pencil is clicked on the Report Page)
This is what my Form Page looks after making some changes to the application
Form fields are not being populated anymore, even though data source is set as a corresponding database column for every field. Does anyone have a clue why the values are suddenly not showing anymore? Which attributes are responsible for displaying data on a Form Page?

When you click on the edit pencil in your report Apex sends you to the form page with a parameter that uniquely identifies the record that you want to edit. This parameter can be the Primary Key or the RowID. You can see this in the URL of the Form page that will look something like this: apex.somewhere.com/pls/apex/f?p=4350:1:220883543::::ROWID:AAAAECAABAAAAgiAAA
Most probably you are not sending the parameter from the Report to the Form page. Go on your Report, click on Attributes and at the Link Attribute be sure to set your ROWID(or PK) from Form Page with the value of the ROWID from the Report Page. Something like in the below img (3 is my form page in this example):

Related

"Oracle Apex error: no data found" when opening a form

I have a very simple Oracle Apex app. I created a button on the home page. I also created a second page using the "Form" template, and the source for this form is a table in the local database.
I set the button to open the form, and I passed the value of the primary key of this form (it's a column called ID) from the home page to the form page, as this screenshot of the button's behavior shows (3 is the page number of the form, P3_ID is the page item in the form associated with the primary column "ID", and 1 is the value that I passed for P3_ID):
The table that the form references is empty, i.e. there is no row with ID equal to 1. Meaning I want to pass the value of 1 to this form so that it automatically create a row with ID of 1 after the user fills out the rest of the form. Here is the form page:
Now the error. When I run the app and press the button, I get this error:
The error says it's from the process called "Initialize form Warcraft Particulars". I searched everywhere and I couldn't find a process by that name anywhere in the app. What am I doing wrong?
Pre-rendering process (in a form) will try to execute query and fetch a row whose ID = 1; as it doesn't exist, Apex raises the no_data_found error. That's why you got it (the error).
Moreover, you're doing it wrong - don't pass ID you'd want to create, fill it in form's process (or use a database trigger which will put a sequence number into the ID column, or use an identity column if your Oracle database supports it (12c onward)).
Furthermore, I'd suggest a slightly different approach: don't create a form that's alone in the Universe. Approach that lets you both view existing data, update (or delete) it and insert new rows is to use a Wizard and choose a report with a form. Exact naming is different from one Apex version to another; for example, current apex.oracle.com Apex version is 22.2 and it offers "Interactive report", while the 1st Wizard page lets you choose whether you want (or not) to include a form page (you'd say "Yes").
Anyway: once you find the correct option, choose it and wizard will then create an interactive report page you'd use to
view current data
it has an edit icon at the beginning of each row which - when pressed - navigates to the form page where you can edit values or delete entire row
create new row (by pressing the "Create" button)
and a form page which does what I described a moment ago.

Apex - set items values after submit

I have to regions with items on my page. One of them is to edit data, another one is display only. Editable region is hidden on page load and shows when users click on a button. I'd like to pass data between these regions after submit a page. Are computations after submit the only way to do that? I tried with processes after submit, before header etc. but it didn't work.
I'd like to have one pl/sql code to pass data between two regions after submit, how to do such a thing?
Other options include
dynamic action (you'd use Set value)
button's Redirect to page in this application (where you'd redirect to the same page; Link Builder then lets you choose which items will be set to which values)
If you still can't make it work, consider creating sample page on apex.oracle.com; then provide login credentials so that someone might have a look.

Oracle Apex - Losing session state when I click on hyperlink that is supposed to direct me to different page in application

I am currently working in Oracle APEX version 5.1.2. I have created an interactive grid in my application that queries data from a table stored in the Oracle database. The data being queried is just several different URLs that refer to different pages in my application. So in other words, in each cell of one of the columns in the interactive grid there is a URL.
Then on a different page in the same application, I have created an interactive report that queries all of the data from the interactive grid. One of the columns in that interactive report is set to type "Link" and the link attribute is set to #LINK#. So each cell in that column contains a hyperlink for one of the URLs stored in the interactive grid.
The problem is that when I click on the hyperlink, I lose my session state and and am redirected to the login page. When I do then login, I am directed to the page in the application that the link was supposed to direct me to. The link only works if I hard code my current session ID in the URL in the database. But I'm trying to find a suitable substitution string for the session ID so that I don't have to hard code the session ID. I have tried the substitution strings &SESSION. and :APP_SESSION and &APP_SESSION. and V('SESSION') and nothing has worked.
Does anyone have any ideas of how to achieve this so that I don't lose my session state?
Thank you in advance.
Update:
Apparently there is no problem with the url formed.
Could you inspect the element and display the generated html on the page?
I think you should not fill in the "link attributes" field, it should be blank.
Click "Target" and there put the value #LINK# in the "URL" field.

Why is my Oracle APEX DML Form stuck in edit mode and not going back to create mode?

I have created a page based on "Form & Report" template. So there is the Report page on which there is the create button. That create button leads to the form page which contains.
It is pretty simple. I don't know if there is a cache memory not emptying itself or if there is a setting that I have not properly set.
When I want to create a new database record, Oracle Apex behaves as if I asked it to update a record (though it still presents me with empty text fields).
Below the image of what's happening.
Create button of the Report
Buttons for edit are shown when I click the create button
Those edit buttons are shown instead of the buttons below => This means that the Apex software is behaving like I asked to edit a record not to insert a record.
Why is this happening?
You need to take a look at your create button. Is it passing a value to the form? If so, you probably don't want that. Is it clearing the cache of the form? If not, you probably want to clear it.
Also, on the form page take a look at your processes.. specifically the Automated Row Fetch (ARF) process.. what's the primary key that this process is using?
Also, take a look at the conditions for each button on your form. For the delete/save buttons you likely want a condition type of "value of item / column in expression 1 Is NOT NULL".
For your create button you would want the opposite.. "value of item /... IS NULL".
In both cases for the expression 1 you'd want to use the item that your ARF is leveraging.
#Bloomberg58 if you used the wizard that should not have anyway try to validate the create button in report page and the server-side validation of create and save button in form page

Oracle APEX default value not working on cascaded items

I have a blank page with a static content region (Template = Form Region). I select a project via a select list (there is only one project, so it automatically selects it). I then have a key popup lov (a popup lov that displays the description not the returned number value) from which I select a person to be in this project. I am trying to get the form to display the person I selected and saved previously when the form launches for the first time (since the project is chosen due to there being one). This works when you refresh the page, but it doesn't work if you log out and log back into the form. I tried using the default value with a sql query. I tried using a dynamic action that fires when the project changes; but neither approaches work. I fiddled with all the settings, but couldn't get anything to work. Does anyone know how to accomplish this in Oracle APEX?
I even added a refresh of the cascading popup lov to the dynamic action. I can see the hidden input item showing my defaulted value, but the popup lov does not display it on screen. Is this an Oracle bug?
Also in Javascript from the console
$s("P51_LINE_MANAGER1", "7104");
sets the hidden value, but doesn't display on screen.
$v("P51_LINE_MANAGER1");
does however return 7104.

Resources