Beginner Oracle APEX - Using ITEMS for a query - sql

So I'm trying to select some names from a table where their set dates are between two dates that I enter via keyboard.
If it was for a single input, where I only use something like (:x) in the region source, I could just create a Text Field Item X where I enter something and press ENTER.
What if I need multiple inputs? like (:x) and (:y).
Upon creating 2 items and entering their values nothing happens when I press ENTER.
The Region Source is this:
SELECT * FROM TOYS WHERE SALE_DATE BETWEEN upper(:x) AND upper(:y);
What am I supposed to do in order to enter two inputs?

If you need to initiate an action (submit the page, for example) by changing value, you have to find a property Submit when Enter pressed in item's settings and set it to Yes. For select lists, the same property is Page Action on Selection, and desired value for it - Submit Page.
Or, you can just create a button. Button's action by default is also "submit page".

Related

Choose one result in Splunk table Query

I would like to add radio button / any way to select - one of the results of my below REST query search,
QUERY : |rest /services/data/ui/views | table id label updated "eai:userName" "eai:data" "eai:appName"
Dashboard showing the results
This Query search is saved as a dashboard (auto-refresh) and I have added few text boxes (User Name, Commit Branch, User Token) as show in the attached image. These text boxes will be manually filled by user.
Use Case: I need to choose any one row via radio button (or any other technical way) and then click on the SUBMIT button to send the selected row data and text box (manually entered by user) data to my custom python script.
What is the way to achieve this use case in Splunk, Any help on this is appreciated.
If you want to pass results of a Dashboard elsewhere, you need to use a drilldown
See the Dashboard XML reference for more
Splunk will only send to a URL, however - so if you want it to go to a "custom python script", it will need to be accessible via URL
What does your "custom python script" do?

In oracle apex, if the value of Upload Status column is NEW, then the Edit Button icon should be disabled

In oracle apex, if the value of Upload Status column is NEW, then the Edit Button icon should be disabled in Interactive Report.
I am aware that some dynamic action has to be added.
The name of my table is intg and it has a column named upload_status. If the value of it is NEW then I should not be able to edit that record.
From my point of view, the simplest option is to disable link column in Interactive Report's attributes and create your own link as part of the select statement. Something like this:
select case when upload_status <> 'NEW' then
'<img src="#IMAGE_PREFIX#ed-item.gif" border="0">'
end as link_icon,
id,
name,
whatever
from your_table;
As the link_icon column contains HTML tags, you'll have to set "Escape special characters" to "No" for this column (otherwise you'll actually see the tags instead of the icon).
Then, in column's properties, set its type to "Link". Edit "Link" section and set it to navigate to another page in this application (you know which one, and which parameters to pass).
That should do it.

Control Source of a text boxes set to DCount function - Refresh issue

I'm setting the control source of text fields to return the value of a function (multiple fields with different filtering conditions). The form has a combo box with a list of years: when the user selects a specific year, the on change event triggers a refresh of all the fields.
My problem is the fields don't show any values unless after combo box's On Change events. I have to click on the form/fields before the values start showing up.
I tried to do form refresh & field's requery but doesn't work.
The text field's Control Source is set to:
=SummaryReport("Projects","G","1",[Forms]![frmSUMMARY_REPORT]![cmbYEARS])
What I'm trying to do is when the user selects a year from a drop down, the fields values are updated & displayed by the On Change event - currently they seem to be updated but are not showing unless I click on the screen and that's when values start showing up in each field.
The method to update calculated fields is Me.Recalc (or myForm.Recalc):
https://learn.microsoft.com/en-us/office/vba/api/access.form.recalc
Try this instead of .Refresh.
Also I think the better event to use is After Update instead of On Change for a combo box.

How to generate adidional fields inside Yii form

I have:
Table "user"
id, username, password
Table "freedate"
id, user_id, start_date, end_date
Each user can have 1 or more (unlimited) number of "freedate" entries.
Now i have form with 2 text fields (username and password), and 2 date pickers (one for start date and another one for end date).
How can i enable user to inserd aditional datepicker pairs so they can enter as much of "freedate" entires as they need to?
I was wondering about insertind aditional button inside form, that would somehow create aditional fields when pressed, but u have no idea how to do it.
I don't need working example (even tho one would help ofc). What i need i suggestion from your own expirience if you had similar problem.
You can use javascript as noted above. Though that can get tricky to get the new fields associated with the datepicker.
You can also submit after each pair is entered. On returning back to form after save insert a new set of start/end date fields to the end of the form. This way they always have a freedate pair they can enter. (a bit slower overall)
You need javascript to generate these fields on the fly. Or a fixed amount of extra fields could be hidden and shown one by one using javascript as the user clicks the button. You would need to keep track of the number of fields being shown in a javascript var.
You need to write custom javascript in order to do that. It isn't hard, you would need to do something along these lines:
You need to create a button and, when that button gets clicked (onClick event or jquery click() function) you can add the html for your field (<input type=.... /> and so on to your form) and remember to use the correct name for these fields so that they get sent correctly when the user submits the form.

Gray out a form row's (detail's) button conditionally with VBA code

I have a standard form in MS-Access which lists a bunch of orders, and each row contains order no, customer, etc fields + a button to view notes and attached document files.
On request from our customer we should gray out the button btnAnm (or check or uncheck a checkbox) depending on a calculation from two queries to two other tables (a SELECT COUNT WHERE and a check if a text field is empty).
I've tried btnAnm_BeforeUpdate(...) and btnAnm_BeforeRender(...) and put breakpoints in the subs, but none of them trigger. The same if I use the control Ordernr instead of btnAnm.
I'd like a function in the Detail VBA code to be triggered for each "Me." (row) so to speak, and set the row's control's properties in that sub.
What do I do? I've looked at the help file and searched here.
*Edit: So I want to do something that "isn't made to work that way"? Ie. events are not triggered in Details.
As an alternative, could I base the value of a checkbox on each line on a query based on the 'Ordernr' field of the current row and the result of a SELECT COUNT from another table and empty field check?
Do I do this in the query the list is based on, or can I bind the extra checkbox field to a query?
A description of how to do this (combine a COUNT and a WHERE "not empty" to yes/no checkbox value) would be perfectly acceptable, I think! :)*
You cannot do much with an unbound control in a continuous form, anything you do will only apply to the current record. You can use a bound control with a click event so that it acts like a button.
Presumably the related documents have a reference to the order number that appears on your form, which means that you can create a control, let us call it CountOrders, with a ControlSource like so:
=DCount("OrderID","QueryName","OrderID=" & [OrderID])
The control can be hidden, or you can set it up to return true or False for use with a textbox, you can also use it for Conditional Formatting, but sadly, not for command buttons.
Expression Is [CountOrders]>0
You can also hide the contents and add a click event so that is acts in place of the command button. Conditional Formatting will allow you to enable or disable a textbox.
As I understand your question, you have a continuous form with as command button that appears on each row - and you'd like to enable/disable the button conditionally depending on the contents of the row.
Unfortunately you can't do that. It seems that you can't reference the individual command buttons separately.
Having wanted to do something similar in the past I came up with two alternate ways of setting up my interface.
Put a trap into the onClick code for the Button. Which is icky, because it is counter intuitive to the user. But it gets you that functionality now.
Move the command button (and editable fields) up into the form header, and make the rows read only. Your users then interact with the record only in the header, and select the record they want work with in the list below. As I recall this is known a Master-Detail interface.