Hi,
I would appreciate some assistance with a Confiforms form, I used the below link with a slight adjustment to limit the entries to two entries per date:
how do I go about enhancing that to limiting the entry per date to one or two entries depending on a check box being checked and if there is already an entry on the date?
Many Thanks
Jonathan
The easiest os to have 2 rules with slightly different conditions.. unless you can put everything into one condition
mydate:[entry._today] AND mycheckbox:true AND _count:>2
Or whatever conditions you need...
More on filters (as these are used as conditions) you can find on our wiki - https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Filters
Alex
Hi Alex,
This works for when the user tries to enter a second entry with the check box checked but if there is already an entry with the check box check on that day I don't want to allow any further entries, how do I include that in the condition or reference it in another condition?
Thanks
J
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I get you right then you need to check for _count:>1 instead
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have it as this:
Date:[entry._today] AND ChangeControl:true AND _count>1
This is running as the condition in a "Confiforms rules for Field Definition" where "Date" is the field name and "ChangeControl" is the check box in the form and what I want to validate against in the data already possibly specified on that date currently in the dataset.
Currently the form will not allow two entries with check boxes ticked but it will allow one ticked and one not (or two not which is fine) but I only want to allow one entry with the check box checked per day.
Thanks again
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You will need a condition like this
(Date:[entry.Date] AND ChangeControl:true AND !id:[empty] AND _count:>=1) OR (Date:[entry.Date] AND _count:>2)
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Alex, this works great in all cases except when an entry exists on a date without a checked box and you add an entry that has the check box selected - it allows it and I don't want it to!
Interestingly if I open the second entry (checked) in the calendar view (on the same date with the other saved entry not checked) and try and save it it won't allow it, the condition then fires correctly!
It's working perfectly for the other combinations.
Any further thoughts would be appreciated?
Thanks
J
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
And this is exactly how it is designed and works (this is how I understood your earlier requirements)
So, what exactly is your requirement?
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At the point where the user saves an entry(with the ChangeControl checked) on a date where there is already an entry without the ChangeControl Checked is the scenario where the above function isn't seeing that the date is not empty.
I only want it to allow 1 entry per day if the Change Control is checked, if an entry already exists (regardless of the checked box) then it mustn't allow it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I dont understand to be honest.. How many records do you want to accept (per day) when the checkbox field is unchecked?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I suggest to learn a bit how the filters work and what you can do - https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Filters
I believe this filtering expression should do the trick
(Date:[entry.Date] AND ChangeControl:true AND !id:[empty] AND _count:>=1) OR (Date:[entry.Date] AND ChangeControl:false AND _count:>2) OR (Date:[entry.Date] AND _count:>2)
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alex,
Thanks again but it's still not working, it's like it's not seeing that an entry is already there and it allows the 2nd entry to be added with the check box even though the filter suggests it shouldn't be more than or equal to 1 if checkbox is true!
not to worry I'll play with it and see if I can get it working.
Appreciate all the help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
delete the 2nd entry for the 2nd Aug and try adding a new entry with the checkbox ticked for the 2nd Aug.
It's shouldn't allow it because it should only allow 1 entry with a check box per day
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
(Date:[entry.Date] AND ChangeControl:true AND !id:[empty] AND _count:>=1) OR (Date:[entry.Date] AND ChangeControl:false AND _count:>2) OR (Date:[entry.Date] AND _count:>2) OR ((Date:[entry.Date] AND _count:>1) AND (ChangeControl:true AND _count:>0))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That works perfectly - appreciate all the assistance. That really helps to also understand the complexity of how the filters work
Thanks again!
J
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The complexity here brings the fact that you want to filter against the existing dataset and check for (different) counts under different conditions.
Usually the filters are much simpler :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's where I was struggling - I tried a few combinations with a _count:>0 but didn't have the syntax correct.
it's been a great learning opportunity
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.