Oracle APEX 18.2 -> need dynamic action based on list of values to make a field required - dynamic

When overall_status in list ('Yellow Trend Up'...etc) then overall_description is required for user to enter information
overall_status:
Select List, Required-Above, Status Values(Red Trend Up, Yellow Trend Up) Dynamic Action * When Event=Custom, item=overall_status, condition=overall_status=Yellow Trend Up
True: Action=Show, Affect Elements=overall_description
overall_description:
Text Field * Appearance=Optional-Above
Validation=Value Required (YES)
When i run application/page and select Yellow Trend Up a Popup window appears with
Leave site? Changes you have made may not be saved Leave Cancel
Not sure what True: Action should be selected

Assuming you want the user to be required to fill in a description field when a certain value from the selection list is selected (like 'Yellow Trend Up' in this example), then a simple way to achieve this is to:
Create 'overall_status' as Select List.
For 'Page Action on Selection' choose: 'Redirect and Set Value'.
Create 'overall_description' as Text Field.
For 'Value Required' choose: 'Yes'.
In the 'Conditions' section of 'overall_description', choose 'Condition Type': 'Value of Item / Column in Expression 1 = Expression 2'.
For Expression 1 enter: 'overall_status'.
For Expression 2 enter: 'Yellow Trend Up'.
If you want to show this required description field if any value is selected in your 'overall_status' Select List, then choose 'Value of Item / Column in Expression 1 Is NOT NULL' and Expression 1 as 'overall_status'.

Related

How to print Field with "print when expression" in jasper report?

I am using jasper studio and I have Field called PAYMENT and TOTAL. PAYMENT is string type which contains values like Cash, Card, Cash Refund and Card Refund.
I am using "print when expression" with TOTAL field like "$F{PAYMENT}.equals( "cashrefund" ) ? true : false".
When a condition is true I am getting value, but if the condition is false, it includes a blank record in the report. How can I avoid printing blank record in the report? Is it possible if TOTAL prints only where there is any value?
set print when expression property to $F{PAYMENT}.equals("cashrefund") and set remove line when blank property is true (isRemoveLineWhenBlank="true")

odoo 8 selection field self always empty

I have to create a selection field based on other column. i mean the data comes from other table but based on current table column value. so i created a selection field as below:
pull_location = fields.Selection(selection='_get_pull_locations',string='Pull Location')
and the function is as below:
#api.multi
def _get_pull_locations(self):
data=[]
** Get the values from other table based on current record **
return [('value1', 'String 1'), ('value2', 'String 2')]
Always when i debug i get self as empty class object ( stock.test()). the scenario is i have a column named zone in stock.test, i have another table called stock.location, so for current record i check the stock.location table where column pull_zone == zone of stock.test and if yes append the selection (pull_location) with that values.
But always the object is empty.
I tried #api.one, #api.multi, #api.model , Nothing happens.
Please help.
Thanks,
Replace your code with following:
#api.multi
def _get_pull_locations(self):
** Get the values from other table based on current record **
return [
('value1', 'String 1'),
('value2', 'String 2')
]
pull_location = fields.Selection('_get_pull_locations', string='Pull Location')
Afterwards, Restart Odoo server and upgrade your module.

PowerPivot - Dax Find Text in another Cell - Cannot get string value

I have what is simple data and I want to return the Home or Motor if a find search returns True.
For Example
Skills Type
I Home Sr
A Mot Pre
Type is my custom column
Starting with just returning True and it fails right here with
=FIND("Home",[Skills])
With
Calculation error in column 'Table1'[]: The search Text provided to
function 'FIND' could not be found in the given text.
Ultimately I want to use If Find is "Home" Return Home if "Motor" return Motor
Desired Output (please note there are other starting variations to the Skills so cannot use a fixed search point in text)
Skills Type
I Home Sr Home
A Mot Pre Motor
Use the following expression for Type column:
=
IF (
IFERROR ( SEARCH ( "Mot*", [Skills], 1, 0 ), 0 ),
"Motor",
IF ( IFERROR ( SEARCH ( "Hom*", [Skills], 1, 0 ), 0 ), "Home", "Nothing" )
)
It will generate Home or Motor for any occurrence of Hom* and Mot*, note the * wildcard
It should produce:
The screenshot shows the table generated in Power BI, but this solution works in PowerPivot too, I don't have access to PowerPivot in this moment.
Note if any occurrence is not found it will put "Nothing" in your
Type column so you can replace "Nothing" by the string you want to
appear in that case.
SEARCH function documentation can be read here.
Let me know if this helps.

ListBox to be filled based on the selection in the previous List Box (Module-pool)

I have a DYNPRO 010 which has 2 listbox (dropdownlist), and I want to fill the second one PEP after selected the first one PROJ automatically, with no enter key pressed.
It works when I choose a value in listbox1 and I press the enter.
Screen 010:
PROCESS AFTER INPUT.
Chain.
field:
wa_screen_010-proj MODULE iniciativa ON REQUEST,
wa_screen_010-pep MODULE field_validation.
Endchain.
ABAP code for module iniciativa:
MODULE iniciativa INPUT.
DATA: ld_field TYPE VRM_ID ,
it_listbox TYPE VRM_VALUES,
wa_listbox LIKE LINE OF it_listbox,
it_prps TYPE STANDARD TABLE OF prps,
wa_prps LIKE LINE OF it_prps.
SELECT peps~pspnr peps~posid peps~post1 peps~stufe
INTO CORRESPONDING FIELDS OF TABLE it_prps
FROM proj AS proyecto
LEFT JOIN prps AS peps
ON proyecto~pspnr = peps~psphi
WHERE proyecto~pspid = WA_SCREEN_010-PROJ .
DELETE it_prps where stufe ne 2.
loop at it_prps into wa_prps.
wa_listbox-key = wa_prps-posid .
wa_listbox-text = wa_prps-posid.
append wa_listbox to it_listbox.
endloop.
ld_field = 'WA_SCREEN_010-INICIATIVA'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = ld_field
values = it_listbox.
You have to make the first list box active by assigning a function code to it. This triggers a PAI-PBO-cycle. Make sure that the function code does not trigger any unwanted function.

How to display the name in an array containg name=>value pair

I'm new to yii framework. I have created a simple dropdownlist.
echo $form->dropDownList($model, 'max_cost', array('2'=>'Yes', '0'=>'No'),
array(
'empty'=>'Choose one',
'onchange'=>'alert(item.value);',
)
);
Now when I select Yes, the alert box will display Yes and when i select no the alert box will display no.
Suppose I want to display 2 when I select yes and 0 when I select no . What should I do for this? item.value displays the RHS I want to display LHS
log the "item" and you will know what are exactly parameters bound to items, then you can alert it or whatever you need:
'onchange'=>'console.log(item);', // here you can see what's inside item