oracle apex 4.2 : populate a form when page is loaded - forms

How can I populate the form when the page is loaded
I have tried an query base form, and a automatic fetch, but neither will display any data when the page loads.

You must create "Automated Row Fetch" process on the page. For each item on page change the "Source Type" to "Database column", and enter column name in "Source value or expression".

When using the page wizard to create a query based form, the query given in the wizard is only used to define the fields on the form and create the corresponding page items. It is not used to subsequently populate data.
For that you need to add a process in a region above/before your form. Make the process PL/SQL type and provide your query there. Assuming your form is on page 2 and has fields ID and Name, use:
select name into :P2_NAME from my_table where id = :P2_ID;
The page or link that calls page 2 will need to set the value for P2_ID.

Related

ChoronoForms v5 dropdown field dynamic preselection

My question is a very simple question:
I want to preselect the single data stored in a previous form in a dropdown field of a form (chronoforms v5).
In other words: In the previous form user has chosen 'New York' from a cities dropdown field.
Next time the user enters in the form he has to see the dropdown field positioned to the city of 'New York'.
Any suggestions?
Thanks a lot
Assuming that your users are registered and logged in them you can save the User ID and the selected value to a database table in the first form; then in the second form use a DB Read action in the On Load event to recover the saved value.

How to automatically populate Custom Item Field with data from a saved report in NetSuite?

Software Platform - NetSuite
Goal - Run a weekly sales report. Use the data from that report to populate a custom item field on the item record (Kit item) in NetSuite.
Can this be done using a workflow or???
Before you try to write a Script or create a Workflow, I recommend you investigate NetSuite's ability to populate Custom Fields with Search Results.
Check out the Help page titled Creating Custom Fields with Values Derived from Summary Search Results for the details.
The basic process will involve creating a Saved Search that generates the data you need, then using the Validation and Defaulting tab on your Custom Item field to select the Search you created.
This should be done using SuiteScript. In your script, run a search, store the data as JSON, and submit the data to the item record. You could submit the data into a single text field on the item record, but it would be better to create a Custom Record Type "Sales Report" which has a list/record field sourced from the item and with the "Record Is Parent" checkbox checked. This will display your custom record on the item in a sublist. Using a Custom Record Type will allow you to store the data over multiple iterations. If you use a field on the item record it will be replaced each time you run the script.

How to pass parameter top LOV query in SpagoBI

How I can pass a parameter to a LOV query in SPagoBI?
I am creating a LOV using query ... something like this:
select id, name
from table1
where parent_id = ${parent_id}
When I click on "Test before save" to evaluate query appears window with title "Profile attributes to fill" asking me to put value for parameter parent_id
Here is a text which appears on that page:
The lov needs some profile attributes.
Your personal profile doesn't contain all the necessary attributes.
To proceed with the test assign a value to the missing profile attributes.
After filling with value and click on Test appears loading icon and stays stucked. I have checked logs. There is no error info in any of the following log files: SpagoBI.log, catalina.out, SpagoBI_[1]_OperatorTrace.log, SpagoBIBirtReportEngine.log
I can see via Express Profiler that query is executed using valid passed parameter but why window stay stucked?
You cannot pass parameter from report to the lovs.
The example given before is of the profile attributes which are passed on the basis of the user logged in.
see the below images for using profile attributes.
first create profile attribute you want to use.
Then you have to fill all the profile attribute corresponding to the user
Then create a lov using profile attribute you want i have created using venueId
see the below image
Now test the lov you will get the response see below image.
Use profile attributes when you want report that is specific to the user.
you can use profile attribute in Dataset query like;
select id, name
from table1
where parent_id = '${parent_id}'
and use the created dataset in LOV.
Please note if query returns only 1 row analytical driver linked to document wont be visible, but will function as expected.
You need to wrap the attribute shortcode with single quotes in the query statement
like this
select id, name
from table1
where parent_id = '${parent_id}'

Cannot see records in form bounded to table in Access

I have a form and it's record source is a table. I created the form separately and added the control sources to the different fields in the form and also changed it's record source. I imported values from an excel sheet into the table and when I open the form, I do not see the tabe values being displayed in the form. Any idea what I should do to see the table records in the form?
In form design mode, check the form's DataEntry property. It sounds like yours is set to Yes, which hides existing records and only allows new entries. Change it to No and you will see the existing records.
Another possibility is that a filter is active and no records match that filter.
Use a form wizard to generate a working form based on your table. Then once you can see the data being displayed in the form, customise as needed.

web2py SQLFORM.factory defaults not updating

I have an SQLFORM.factory on a page that I use to(among other things) update a particular field in a table. That field is a drop down table I made like so
Field('visibility',requires=IS_IN_SET(['everyone','subscribers','friends','nobody']))
So the field in the SQLFORM.factory looks the same. The difference is that I want the default in the SQLFORM.factory to be the current value of that field in a particular table. by making a default. I do a query on the desired entry on the table, select that field, and that becomes my default, the selected option. Perfect the first time you load it up.
I do the update after the form accepts like so and the update works functionally:
if subForm.accepts(request,session,dbio=True):
if myForm.vars.visible != theDefault:
db(row).update(visibility = subForm.vars.visibility)
If you submit the page the selected option is not the current value of that field in the table, it's always the one it was previous. If I look at my database admin the table updated fine but I could not fetch the right option to select as my default. If my default was 'everyone' and then I select and submit 'friends' then the selected when the page reload after the submit is still 'everyone' If I then select and submit 'nobody', after the refresh it is 'friends'.
If it helps, I am displaying the view this SQLFORM.factory is in in and iFrame as part of a bigger page.
After many hours, here's how you do it(sorta hackey but it works)
#This is a kludge to get the right default visibility selected
if request.vars.visible == None:
visibleDefault = theDefault
else:
visibleDefault = request.vars.visible
form = SQLFORM.factory(
FIELD(Field('visible',requires=IS_IN_SET(['everyone','subscribers','friends','nobody'],zero=None),default=visibleDefault),
table_name='table')
if form.accepts(request,session,dbio=True):
if form.vars.visible != theDefault:
db(row).update(visibility = form.vars.visible)