Skip to main content

Runtime Modification Assign Null Dates

Comments

9 comments

  • Permanently deleted user
    Try something like this:

     

    form.Find(Of DatePickerFormItem)("DatePicker3").InitialDate = if(featureSet1.Features(0).Attributes("Public_Open_House") is nothing, DateTime.Now,cdate(featureSet1.Features(0).Attributes("Public_Open_House").tostring).AddHours(-8))

     

    I'm not sure what you wanted to place for the initial date if it is indeed null, so I set it to today.
    0
  • Dan Griffin
    Thanks Marshal.  Is there a way to mantain the date as null rather than setting it to a value?  I can set DateTime.MinValue but I'd rather keep it as null.  
    0
  • Permanently deleted user
    Ok, then i would put it in it's own if statement.  So here if it is null, don't do anything, if it isn't null fill with 8 hours previous to the DateTime attribute: 

     

    _img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=90760000000XakW&feoid=Body&refid=0EM60000000XqmX" _/_img_
    0
  • Dan Griffin
    Perfect.  Thanks!
    0
  • Permanently deleted user
    I have a form that has multiple date selection fields. Some will be filled in at a times and some will not. The issue is that when a date is not picked it assigns a date anways. I would like for the initial date in these fields to be null. Currently I have an "assign" in the RuntimeModifications with form.Find(Of DatePickerFormItem)("DatePicker1").InitialDate on the "to" side but I am unsure what to do on the "Enter a VB..." side. Any suggestions would be appreciated. Thanks!
    0
  • Dan Griffin
    If you use the variable type System.Nullable<System.DateTime>  then the form dates should appear as null by default.  This is new as of GXE 4.4.3
    0
  • Permanently deleted user
    I am also working on a workflow where users can enter multiple inspection dates in a form. Only one date will be entered at a time so I am trying to enable assign activities in the runtime modifications to get the date to repopulate the fields when the form is opened again. I've gotten this to work when I only have one assign activity...

     

    _img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=90760000000XcxN&feoid=Body&refid=0EM60000000XwRL" _/_img_

     

    However, when I add an assign activity for the two remaining date fields, I get an error saying 'there is no row at position1'. I believe this is because, if only one date has been entered into the form, the assign activities get confused becuase there are no dates to pull. Im pretty sure I need an if statement, I'm just unsure of how to configure it. Has anyone else experienced anything like this?

     

    There will be instances though where they will need to go back into the form and update the dates. I am trying to use an assign activity in the runtime modifications so any dates that have already been entered will automatically  be populated in the form when it is opened again...I think I"m on the right track  because I've done this with text boxes before, but not date pickers...any suggestions?
    0
  • Permanently deleted user
    Hi Lisa

     

    lots of programming starts counting at 0. Try replacing your 1 with a 0

     

    Ralph
    0
  • Permanently deleted user
    Yes, I actually had 0 there originally, when I got the errors I changed it to 1 to see if that would fix it, when I took the screenshot I forgot to put a 0 back in. Unfortunately, that's not the issue. Thank you though!
    0

Please sign in to leave a comment.