Need Help with view table.
I have the this formula and works excellent, I can search by Name and Dates at the same time. (Two search), but I will like the view table appears without information when I open the search table. Is possible.?
let me := this; let myS := ""; myS := myS + if Search then "N" else "_" end; myS := myS + if Date_From then "V" else "_" end; myS := myS + if Date_To then "B" else "_" end; switch myS do case "NVB": (select Data)[contains(Nombre, me.Search) and FECHA >= me.Date_From and FECHA <= me.Date_To] case "NV_": (select Data)[contains(Nombre, me.Search) and FECHA >= me.Date_From] case "N_B": (select Data)[contains(Nombre, me.Search) and FECHA <= me.Date_To] case "N__": (select Data)[contains(Nombre, me.Search)] case "_VB": (select Data)[FECHA >= me.Date_From and FECHA <= me.Date_To] case "_V_": (select Data)[FECHA >= me.Date_From] case "__B": (select Data)[FECHA <= me.Date_To] case "___": (select Data) end
One way is to hide the view until there is something in the search fields.
Another way is in the switch command there is a “default” case, so you can try putting null in there.
case default: null end
i don’t know if Ninox will accept this. If it doesn’t then you can put in a search that you know will always return an empty set.
Fred / Rafael- I could not ever get this to work with either Null nor " "
(obviously hide form view - will work) but I want to leave the grid visible at all times
I did get around it by piping a period into one of my search boxes (form script in my button)
sample show 2 x search boxes (item and ref) with period
and without period
a bit crude but ....
To be honest - it has just dawned on me that this really is only another way of saying show hide the form. The only difference is that you either see the grid or not - so you could go on to display a table place holder like an image!!
So probably a better way is to use a yes/no option "checkbox" (DisplayFlag) option instead of the button and set the table view "show display if" option to DisplayFlag = true (or false if you want flag the other way around!
You could go on further to have the search field - trigger after update set the flag. and use another field to reset the same flag. you can't your for trigger.
you can't use the form trigger after update as this would instantly close the option as soon as it was opened which would be no good.
Wouldn't it be great if we had a trigger on form open and close !!! with out any modification taking place?
I try with this Formula sum the hours in Data Table for the people, I place in the Search field.
But don't work any idea.?
let search := lower(Search); select Data where number(HORAS) = search
In line 1, the lower(Search) implies text is involved. What kind of field is Search?
In Line 2 you are using number(HORAS), which implies you will get a number back. So you can't compare the two.
Since you are looking for people's name you need to use the field that stores the people's name. I'm guessing HORAS does not store people's name. Looking at your structure you need to use the following code in Formula 2.
let search := lower(Search); let x := (select Data)[lower(STAFF.Nombre) like search]; concat(x)
plus since you are probably not typing in a person's full name you should probably use like instead of =.
If you want to put this in your view then you can remove the let x and the concat as these are only for display purposes.