Playframework: Dynamic Search Fields - search

I need to implement a search dialog within play but don't know to solve this.
I have 3 integer fields in my database and want to search each of them with min and max values:
select * from office
where maxSeats <= maxParamFromPage
and maxSeats >= minParamFromPage
...
All fields are optional so if a user only enters the minParamFromPage all offices should be listed which are higher than this param. Now I have 3 params like maxSeats and I need to buildup my query dynamically based on the input parameters. I thought about replacing them with "0" or null when those are not entered but this is placed one to one in the sql query.
Can somebody help me on this?
Thank you!

You should used JPA Criteria API to construct your criterion based on the form values.
Refer this example

Related

How to extract the data using FILTER function in excel?

Hi everyone,
I want to extract the rows where Action 1 & Action 2 appear in the same Group. Which means, if the particular group only have either Action 1 or Action 2, then it will no extract the data. In the screenshot above, only Group A and Group C have both Action 1 and Action 2, so the formula will extract it out.
I'm able to use Query function in google sheet to do this but I'm not sure what can I use in excel. I'm trying to use FILTER function. Hope to get some advice on this any help will be greatly appreciated!
Use MMULT to find the correct Group and Match to bring only the correct action.
=FILTER(A3:B12,(MMULT(COUNTIFS(A:A,A3:A12,B:B,{"Action 1","Action 2"}),{1;1})=2)*(ISNUMBER(MATCH(B3:B12,{"Action 1","Action 2"},0))))

Multi select employees in Employee Time Activities

I was trying to enable multi-select for Owner in Employee Time Activities and wanted to try based on below article.
https://asiablog.acumatica.com/2018/01/multi-select-selector.html
Then override view like below:
https://asiablog.acumatica.com/2017/11/sql-in-operator-in-bql.html
However, after I added ValidateValue = false in field:
I am getting this error.
I looked at the custom attribute and I don't think it could be replaced with anything keeping the same implementation.
So, is there any other way I can accomplish multi select feature to allow display Employee Time Activities for selected employees at once besides the ideas mentioned above?
Thanks.
Your primary issue is that DimensionSelector is different than Selector.
Secondary thing to keep in mind that when you do Multiselector you would need to update the field that holds the values to have a longer length. The way a multiselector works is that it stored the saved values as a ; (semicolon) separated string. so if the field was 10 long you would want to expand to whatever you expect the max number of selected values would be, e.g. 40 would be 480, 40x10 + 40x2, 10 being the original size, 2 being a semicolon and space. (hope that makes sense :) )
Next you would have to update all the functional business logic to then parse that string and loop each, in this case, employee for the functions.
I am speaking very generically here. So not sure what you're actually attempting to do here, but one would assume that if you were selecting multiple employees you would want records to reflect accordingly.

Display logic based on field's value length

Is it posible to create a display logic condition with the size or length of a field's value?
For example: #upc.length#<13 or anything like that?
I have tried it that way but it is not working. I would appreciate if anyone knows the logical operators for this. In the openbravo howtos is not very explanative.
Thanks.
As suggested in the comment, use an auxiliary input.
Auxiliary Input
Name : upcLength
SQL
select (case when length (upc) > 13 then 'Y' else 'N' end) as length
from table where table_id = #table_id#
In Windows, Tabs and Fields, for a field add the display logic.
#upcLength#='Y'
PS: Assumed DB Postgres.

How can I have complex formula field in a saved search

I am new to Netsuite. I would like to compute a complex grouped result field in a saved search, say, average(price) * max(amount).
I known SQL, and something called formula in Netsuite. I have tried composing a formula to compute it, but failed.
Is it possible to compute such a complex filed with formula? If not, how ? Javascript custom code? Please give me a little hint, thanks.
On the "Results" tab of the custom search, select the fields you want to retrieve the Average and Max value, and then on the "Summary type" you select Average or Maximum depending the field.
Then you add another field which will be a "Formula (numeric)" and on the "Formula" column you put
{averageField} * {maxField}
There's a pop-up that helps you with that.
- Hope I was clear, good luck.
- Also I hope I answered on time.

How can I make an InfoPath textfield within an repeating table auto increment?

Within my InfoPath form (which has to be loaded within a SharePoint Portal by the browser)I have a repeating table containing multiple fields. Now I would like to make the first textfield autoincrement starting by 1. How exactly can I do this?
I have already heard of a way by using the "count" function but this produces errors or in best case a static number which unfortunately does not count.
The function I have added for the field is "count(.) + 1"
Any suggestions?
Let's say your repeating group is called "item" and your autoincrement field is called "index". The default value of the index field should be
count(/my:myFields/my:item)
This should count correctly for you.
I suspect you really want position(). Count is just going to return the total count of nodes that match the xpath expression you give it.

Resources