Oracle Apex 19.1 (how to add, edit, delete data through a form) - oracle

I'm new to oracle apex so this might be simple.
I have an application that i'm currently building. I have an 'employee' table in the SQL workshop. When i attempt to create a form linked to the table there is no option to edit, delete, or add entries into the table ,once the form is completed?
This is essentially what i need help with. I need to be able to manipulate the 'employee' table through the form created rather than through anything within the sql workshop. Just for context i am not the workspace admin, however i am a contributor.
I would appreciate if anyone could provide me with a quick step by step guide into creating this desired form accurately.

I'd suggest you to create (using the Wizard, of course) Report with Form on Table. It will create
interactive report you'd use to view data stored in that table
form which will be used to insert/update/delete data
the same form will be called when you push
the "Create" button in order to create new rows, or
icon at the beginning of every line in the report in order to update/delete rows
This combination (report + form) works nicely for ages, so ... try it. I hope you'll find it useful.

Related

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.

Unable to retrieve report data using Dynamic Action in Oracle APEX

I have two tables: Application (PK: Application_ID) and App_support_domain (column: team_name, FK: Application_ID referencing Application table)
I am trying to display the data present in the Application table based on the selection of team names.
I have created a LOV popup (P2_NEW) to select the team name.
After selecting the team name I want to show the application data in the form of a report, so I have created a dynamic action that will show the body region which has the application data.
But the SQL query that I have written does not return any data. I think it is not taking the P3_NEW LOV value and displaying the application data.
Please let me know if you need more info/clarification.
Could you please take a look and help me out?
A "show" dynamic action will not resubmit the report. Add 2 actions to the dynamic action. One to refresh and an 2nd one to show. That will force the report to to refresh. Make sure you put P2_NEW in the "Page Items to submit" for the report.

How can I create a insert/update form for multiple table in Oracle Apex 5.1.4

I have craeted two tables. I have also created a page and shown all data as classic report by inner joining between two tables. Now I want to know how can I create a form to update both table at a time?
For single table it can be done easily by creating form and report page. But In case of multiple table what will be way?
Thanks
Create new page by the new page creation wizard using the Form > Single Page Master Detail template.
It will guide you.
Here's one option: create a view, then create instead-of trigger(s) upon that view. Use the same view as a data source on the Apex page.
I know for sure that it works in Oracle Forms; never tried it in Apex, though, but I believe that it should be just fine.

Proforma SalesInvoice doesn't show data from all tables

In the salesInvoice ssrs Report i have added a table called carTableEquipTmp which is not there by default, which I insert into along with the other tables(SalesinvoiceTmp and SalesinvoiceHeaderFooterTmp) in SalesInvoiceDP.InsertIntoSalesInvoiceTmp().
Even though my table carTableEquipTmp is getting successfully inserted into, the data doesn't show up on the report if i print a proforma report.
If i add test values to the carTableEquipTmp table in SalesInvoiceDP.processReport() they show up on the proforma invoice, but there's no way for me to get any parameters needed to set in the correct data into the table at this point. If i stop at this point in the debugger none of the data is present because processreport() is being called from a lower level in the code.
I think it might be a problem with maybe pack/unpack or that the proforma code runs from a server instance as the code run when it is proforma is quite different.
I can see that SalesInvoiceJournalPostBase.CreateReportData() creates an instance of salesInvoiceDP
salesInvoiceDP = new SalesInvoiceDP();
salesInvoiceDP.parmDataContract(salesInvoiceContract);
salesInvoiceDP.parmUserConnection(new UserConnection(true));
salesInvoiceDP.createData();
And that this might have something to do with it... but i still cant get the data i want in the carTableEquipTmp table.
So any idea on how to make Ax 2012 accept this new table i have added as it gets inserted into just like the other tables and there seems to be no problem...
I hope you guys can help.
The SalesInvoice report has two data classes you need to look at for the data provider, SalesInvoiceDP and SalesInvoiceDPBase. SalesInvoiceDPBase extends SrsReportDataProviderPreProcess, so there are a couple extra steps you need to take in order to add new datasources to the report.
In the salesInvoiceDP class, there is a method called useExistingReportData(), which re-inserts the pro-forma temp table data under a user connection, so the SrsReportDataProviderPreProcess framework will pick it up in your report. When the pro-forma process creates the report data, it doesn't insert with a user connection so it doesn't get added to the report. This method only gets called when the report is being run pro-forma.
You will need to add your temp table to this method, and follow the pattern for the other tables, so your code will look something like this:
//this is different from the buffer you insert your data with
CarTableEquipTmp localCarTableEquipTmp;
...
recordList = new RecordSortedList(tableNum(carTableEquipTmp));
recordList.sortOrder(fieldNum(carTableEquipTmp, RecId));
//You will need to add a field to relate your temp table
//to the current invoice journal, and insert it in
//InsertIntoSalesInvoiceTmp() if thats where you're inserting your table.
while select localCarTableEquipTmp
where localCarTableEquipTmp.JournalRecId == jourRecId
{
recordList.ins(localCarTableEquipTmp);
}
delete_from localCarTableEquipTmp
where localCarTableEquipTmp.JournalRecId == jourRecId;
recordList.insertDatabase(this.parmUserConnection());
This method re-inserts your data under the framework and deletes the original data. The data that was re-inserted will then get picked up by the framework and show in your report. If you open CarTableEquipTmp in the table browser, you will most likely see data still there from all the times you have tried running the report. This is why we have the delete_from operation after we re-insert the data. When data is inserted under a userConnection, it is automatically deleted when the report is finished
The other method you will want to modify is SalesInvoiceDP.setTableConnections(), and you will just need to add the following line:
CarTableEquipTmp.setConnection(this.parmUserConnection());
This will set the user connection for your table when running regular (not pro-forma). You will probably want to delete the data that is stored currently in your temp table using alt+F9 from the table browser.
Other than that it's all standard RDP stuff, but it sounds like you have that part working fine. Your temp table must be of type "Regular" for this to work.

Using Oracle Forms(4.5) do_key commit_form fires which trigger and where is its code?

What tool is used to view the Key Triggers? Is it the Oracle Terminal for Windows?
do_key('commit_form'); fires which trigger and where?
(we do not have all the tools and we want to convert, the DB is not even restored at this point) but I am assigned to figure it out. :)
We do not have even a .res (resource) file, and I am guessing this is used for mapping form fields to database columns?
do_key('commit_form'); would fire the KEY-COMMIT trigger, if there is one. If there isn't one, it will just do the default action of that trigger, which is a commit.
Any key triggers would be in the form itself, most likely at the form level, and you would view the triggers using Oracle's Forms Builder.
The form field to database column mapping is also within the form. The block properties will indicate which table or view, and the field properties will tell you which column. In my experience, the fields and the columns usually have the same name, although that is not strictly necessary.

Resources