have a look on this post How to connect Forms with JS Function returning an argument
Is there a better way of preventing double-booking of an event in a Nintex form
in sharepoint you can never reliably avoid double booking (resp. parallel entry of the same information) until you configure a field to 'Enforce unique values'
Thank you Marian, I did look at the post and modified my lookup to try the "length" function, but I get the same results where the validation rule is causing an error to be returned behind the scenes.
not(equals(length(lookup("ARB Calendar","EventDate","EventDate","ID")),0))
or
not(equals(length(lookup("ARB Calendar","EventDate",StartTime,"ID")),0))
There seems to be something happening either deeper in the JS or on the server that is causing this problem. Is there somewhere I should be looking beyond the Console window in Chrome or IE for additional information?
I think I've found a very very janky workaround. Given that calculated fields are pulling back information appropriately, I've moved my logic there, such that it evaluates to "true" or "false". Then in my validation rule I'm checking the calculated control for equivalence to "true" to trigger the validation. This seems to be working so far, though I'd love to solve the core problem rather than use this hack.
you miss there one additional parameter in lookup() function call.
try following
not(equals(length(lookup("ARB Calendar","EventDate","EventDate","ID",true)),0))
check item exists double booking double entry
This only works for checking that exact date/time, not whether or not the StartDate falls within another events Start/End time. Did you come up with a solution for that scenario? Thank you!
this is not possible with lookup() function.
it only can make comparison for equality.
Thanks for the information Marian! Do you know of a way to achieve a true double book check? I see that the lookup can return back an array of items, is there anyway to leverage that data?
Do you know of a way to achieve a true double book check?
sure, I know.
do not use sharepoint
to be serious, note my above statement
in sharepoint you can never reliably avoid double booking (resp. parallel entry of the same information) until you configure a field to 'Enforce unique values'
you can hardly avoid double booking from client side. definitely not with sharepoint.
it has to be ensured on server/data store side. sharepoint provides an option 'enforce unique values' for a single list field.
if that's not sufficient for you, you are out of luck.
I see that the lookup can return back an array of items, is there anyway to leverage that data?
yes, lookup() function can return array of values. but still just for equality condition (eg. StartTime == <Todat at noon>)
for complex conditions like MyTime falls within date/Time range you would either would need to script it out or check afterwards with workflow.
do not use sharepoint
haha! I'm beginning to figure that out. We are currently using the old 2010 group work site feature but I would like to find a solution that can migrate/scale with SP as we upgrade from 2013 and beyond. Any recommendations? I was hoping to achieve with Nintex but not looking like I can.
it has to be ensured on server/data store side. sharepoint provides an option 'enforce unique values' for a single list field.
I've seen that column on the list but am unsure of its purpose. Do you know?
We do have Nintex Workflow as well to check after the fact, but the ability to see before an event is created is very much desired by the client.
I've seen that column on the list but am unsure of its purpose.
see reference Enforcing Uniqueness in Column Values
Hi
Can you share what your form looks like and what field(s) is comparing to?
I have two date fields: StartDate & EndDate and need to compare a List if the dates fall between FromDate - UntilDate