I guess your "Aktuelles Datum" is common property "Current Date", "Aktuelle Zeit" is "Current time", "Selbst" is "Self"
Current time is just time without date, and Self returns whole date time so you compare different things.
I think you are not able to compare it with these properties.
I would do it so that I would place another date-time control on the form and set its default value to 'today' and then compare start date against value of this control.
however, note that 'today' rounds up to the next full hour. if you would like exact hour&minute values you would need to set it by javascript in a similar way as I will show bellow.
The second problem is that I want to set the end date = the start date, when the user sets the start date, cause most meetings end on the same day. How can I do that? |
you will have to do it by javascript.
the script might look like this.
NWF.FormFiller.Events.RegisterAfterReady(function () {Â
      NWF$("#"+StartDateVar).change(function () {  //sets the date box
            NWF$("#"+EndDateVar).val(NWF$("#"+StartDateVar).val());          Â
       })
      Â
      NWF$("#"+StartDateVar).parent().find("selectÂid*='DateHours']").change(function () {  //sets the hour box
            NWF$("#"+EndDateVar).parent().find("selectÂid*='DateHours']").val(NWF$("#"+StartDateVar).parent().find("selectiid*='DateHours']").val());          Â
       })
      Â
      NWF$("#"+StartDateVar).parent().find("select id*='DateMinutes']").change(function () {  //sets the minutes box
            NWF$("#"+EndDateVar).parent().find("selectnid*='DateMinutes']").val(NWF$("#"+StartDateVar).parent().find("selectNid*='DateMinutes']").val());           Â
       })
})
The third question is, if there is a way to check if a validation is needed, depending on another validation. At the moment I have two validations on the end date field: |
you can not setup dependencies between single condition, but you can build more complex conditions using logical AND, OR, NOT...
so may create a condition like:Â Â istNullOderLeer(Selbst) && Selbst < SitzungsStart
or using runtime functions:Â and(istNullOderLeer(Selbst), Selbst < SitzungsStart)
Thank you very much for your answer, but i still need a little help, cause i never worked with Forms before.
So i though i would just add this script to the custom javascript of the form and activate /name the date/time fields that way:
I also created to form variables:
But nothing happend :/
yes, copying script and setting javascript variables for datetime picker control should be enough.
you do not need any form level variables.
open developer console and check whether you don't get any errors.
sometimes copying directly from browser may break the script.
maybe I would as well checked how your elements are labeled in HTML structure (I mean 'DateHours' and 'DateMinutes'). since all your environment seems to be in german, they as well might have got translated.
Thank you, it was the missing ";" at the "RegisterAfterReady"
Edit:
I have the date in a repeating section ist there a way that this works vor every line?
sure, it is.
you just need to identify which row you are currently reading source control value from and copy the value to the target control within the same row.
have a look here how to identify current row and how to read values out of controls within that row Current row in repeating section nintex forms
Maybe it helps to know that you can add a date/time variable to your workflow which you default to now which is date + hour + minute or you compare with field "Created" which is accurate enough.
Of course, using InfoPath forms or Constraints in SharePoint columns is another way to avoid that a bad entry is submitted at all.