Oracle Apex List of values selection and button disable upon repetition of same selection - oracle-apex-5

I have an interactive report with two regions.
The first region is static region with a select list and a button to submit the process.
The second region is the report region which refreshes the region based on first region select list value and Process (calculate) button submitted.
However if I try to submit same item (List of values) subsequently the process button must be disabled. (i.e) Any repetition of same List of values, once calculation or process is performed, the calculate button must be disabled and these are all based on input selection from front end.
Please note there is not any direct relationship between the Select list button (Page item) and second region columns and I cannot achieve it by distinguishing at database level if it is processed or unprocessed, as there is not any column maintained in database tables (in this case second region about year which is processed).
How can process be disabled second time?
and only if select list for quarter is entered for first time the process button (Calculate) must be enabled based on.
The second region values are populated/refreshed by swapping the columns this_year_q1 to last_year_q1, last_year_q1 to year_before_last_year_q1 etc., if calculate button is enabled and process is called.
So in below case, the calculate button is enabled when select list is (Quarter is Q4:01/10/2017 to 31/12/2017), this is fine and must allow process for first time.
Subsequent reselection of same value must not allow process to calculate.
1:

Here's an idea:
create a (hidden) page text item
using a dynamic action on a button
compare current Select List item's value with hidden item's value (don't forget the NVL function!)
if they don't match, put current (selected) Select List item value into the hidden item so that you could check it when the button is pressed once again (i.e. whether user selected the same value or not) and submit
if they match, do nothing (don't submit)
If you don't want to run the report twice not only for subsequent executions but during the session, you'd have to store selected values somewhere (a table?). The rest would be the same - you'd only have to select from that table and compare Select List's values with values already used.

Related

MS Access: Reset input field in form to default value 0 upon exit form

EDIT: The fields shown in pictures below all have "value list" as row source type. The input in these fields are used in queries that pull data from tables as well, but these fields themselves do not use any tables.
I have a form in Access that requires users to provide input via listboxes, and then queries use that data to perform calculations.
However,when the entire access file is closed, the same input values are still in the listbox after reopening.
Ideally I want the values in the input fields to default to 0 (not null) as soon as the access file is closed (or re-opened), so when the user opens the database, he will see the value "0" in those fields. The reason to why I want the value 0 as default is because the inputboxes reflect possible commodities a product can contain, and I want to allow users to define the % commodity a product does or does not contain. 0 means the product does not contain that commodity and the user does not have to change the value in the listbox (more user friendly in my opinion). Picture illustration:
Hence each time I re-open the access file, I keep seeing those input values above, while I want them to be 0.
I did some research but don't really understand how to use the expression builder, and I can't find a way to make it work via a macro. I read something about the listboxes having to be 'bound', but I'm not entirely sure how to deal with this.
This is the above listboxes in design view:
You are using listboxes but at a height of one selection which is not the optimal use for such a form control as no multiple listing is shown at once together.
Consider using free-form textboxes with a default value of zero. But if you need to control a user's input, use combo boxes which defaults to the zero selection item. Most likely right now, each listbox is defaulting to its first selection item.
Here is how the Property Sheet / Data Tab of the combox would look (in fact Default Value might be redundant as zero is the first item):
Row Source : 0;20;40;60
Row Source Type: Value List
...
Default Value : 0
If combo boxes use a table/query row source, you will need to append a value of zero with a UNION query:
Row Source : SELECT TOP 1 0 AS ColName FROM TableName UNION SELECT Val FROM TableName;
Row Source Type: Table/Query
...
Default Value : 0

How to perform multiple selections in a Qlikview Straight Table?

How would I go about making multiple selections in a QlikView straight table?
For example, how would I select the 1st and 5th rows at the same time?
There is a section about multiple selections in the QlikView 11 - Reference Manual :
14.5 Multiple Selection Within a Field
Multiple selections within a field (from one lisstrong textt box) can be made in a number of ways:
Position the cursor in the list box, then drag it over a number of field values while pressing the
mouse button.
Click the first field value to be selected, then CTRL-click each additional selection.
Click the top item to be selected, then SHIFT-click the bottom item to be selected. This way all the
items in between will be selected. However, if the sort mechanism is on, the first selection may cause
the order to change, which makes it difficult to make a correct second selection.
Confirm a text search (see below) by hitting the ENTER key. This will result in all matching field
values being selected. By keeping the CTRL key depressed while pressing ENTER the selections
from the text search will be added to previous selections.
To deselect a previously made additional selection, CTRL-click it.
If a multiple selection is made in one list box, and make a new selection from the available optional values
in another list box, some of the selected values in the first list box may get excluded. However, when the
selection in the second list box is canceled, the previous selections will, by default, be recovered.
A multiple selection can be interpreted in two different ways, either as a logical or or as a logical and.
Default is logical or, i.e. QlikView will find a solution that is associated to one or more of the selected field
values.
HTH
For straight tables, you can only select items next to each other. Ctrl-Select only works for listboxes

Continuous form with dependent combo boxes

I have a continuous form that has a dependent combo box on it. I have the dependent working individually for each row/record BUT the dependent combo box is blank unless it has focus then it shows the saved data so what I did was placed a text box over the data portion of the combo box and set its control source to the same field as the dependent combo box and required and it worked great BUT unlike a combo box which would show the name it shows the saved data which is a ID number so I guess my question is how can I show the name and not the data?
Thanks!
You'll need to clarify, but if the combobox is bound to a field of the form, and its RowSource displays two columns - say an ID and Name - then giving the first column a width of 0 will persuade it to display the Name, rather than the ID.
You will also need the Column Count to be 2 (or more) and the Bound Column to be 1 (the ID). Then set the Column Widths to 0cm;2cm (add more values if more than 2 columns).
Added
Remove this criteria from your cobmobox's Row Source:
[Forms]![frm_DelayMachineOutputSubform]![cboCategory]
It is not needed. The ActivityID (and the CategoryID) are obtained for each row in the form.
Remove these lines from the Current event as well:
Me.cboActivity.Requery
Me.txtActivity.Requery
again, they are not needed (and cause the flicker). Better yet, just delete this event-code.

How to get min/max values on form that returns multiple records

I've got a form that returns multiple records from a table. Each of these records has a field indicating what the measurement was and the measurement's value. My form's record source pulls the appropriate ID's set of measurements and values, and then I want to write each of these measurements to different text boxes on the form.
The problem is that I'm also keeping track of the date this data was updated, and want to include only the data pulled based on the "date updated" selected at the top of the form.
When I go to pull the measurement value into a text box (with something like max(iif(Measurement="Acidity", [Value],[Null])) I get #Error all down my form. This had been working earlier today, and as I've been developing the form something changed and now it no longer works (everything but the date returned is saying #Error). I've set it to Requery when the form loads and whenever the date selected is changed.
EDIT:
This form is actually a subform of another main form. The main form has a control called MemberID which a user can use to select the Member they want information about. This is based on a query that pulls from a table the information related to that MemberID (one row per MemberID). When the form loads, the query behind the main form needs to be requeried to get the data for the selected MemberID.
Then there is this subform causing the problems. On this subform is a "Data Updated" drop down box, which lists the possible dates that the data was updated. When one chooses a particular "Data updated" in the drop down box, this chooses the latest data for all the data measures up to that date selected. This means the form's record source pulls about 10 records in my case.
Then, on this subform I try to layout these 10 records' values in different text boxes. So, in my acidity case above, I would say iif(Measurement="Acidity", [Value], Null). Because there are 10 rows returned, I will end up with 9 Nulls and 1 value, and to get that value I use the max function, so the text box's control source reads: max(iif(Measurement="Acidity",[Value],Null)).
The strange thing is this code was working this morning, until later this afternoon when I was filling in the remaining text boxes with similar code, and then it stopped working. I had also renamed the boxes from Text71 to more relevant names, but none of these are referenced in the code.

Copy a value based on criteria Salesforce

On a Salesforce.com opportunity I have a number of custom fields that are potential options that the end client will eventually select.
Option 1 (Desc Field) Option 1 (Value)
Option 2 (Desc Field) Option 2 (Value)
Option 3 (Desc Field) Option 3 (Value)
At a future point the user will ultimately choose one of the options as the preferred option. What I want is then the value for the chosen option to be stored in another field without the user having to enter it again. A “nice to have” would also be that all 3 option descriptions, values and selected value are locked once this is done.
Any ideas?
Two things come to mind:
(1) The second field could be a formula field that derives it's answer based on the first field.
(2) A workflow rule using a field update to set the value of the second field, using a formula
(3) A trigger to do the same as #2.
As far as locking, one semi-popular method to lock a page layout is to essentially have two page layouts. The first layout has the fields normally, the second layout has the fields with "read-only". You then create a record type called "Read Only", for example. After the user has entered some specific information in a specific set of fields, a trigger could then check the record type from the normal default one, to the "Read Only" one.
To the user's point of view, the record will be the same, but now he sees it from a different page layout.