Hi On a SAIL form I want that as soon as I enter a date, the next date inpu

Hi
On a SAIL form I want that as soon as I enter a date, the next date input field should be popped up on its own so that I can enter another date(if I want to) before hitting the submit button.
For this I took the help of SAIL Recipes where it is written to do the same thing but with text as input. The link to the SAIL recipe is:
forum.appian.com/.../SAIL_Recipes.html

I tried out initially with the text field and after entering data for 3 text fields I got an error (Please refer Text Error).
I modified the code for entering the date field but I could enter only 2 date inputs and when I clicked here and there on the screen I got an error too (Please refer Date Error).
Can anyone please guide me as to why am I getting these errors and how to accomplish my task.
I am working on version 7.6.
Thanks in advance!!
...

OriginalPostID-134858

OriginalPostID-134858

  Discussion posts and replies are publicly visible

  • Hi komalc,
    Can you please check for any relavent information in the log files.
  • Hi, komalc
    I have tried the scenario using the above mentioned recipe. Its working fine even for dynamic date fields. I think you have missed out something in the code.

    Please check with the below code and find the attached image, which results after executing the code:

    Main Expression
    ---------------
    =load(
    local!guests: {""}/*declare empty array */,
    a!formLayout(
    label:"Dynamic Date Components",
    firstColumnContents: {
    a!applyComponents(
    function:rule!dynamicFieldEach(index:_,guestArray: local!guests),
    /*pass empty array to the rule. this rule
    appends a new empty field when one component is filled*/
    array: 1+enumerate(count(local!guests))
    )
    },
    buttons: a!buttonLayout(
    primaryButtons: a!buttonWidgetSubmit(label: "Submit")
    )
    )
    )

    Rule (dynamicFieldEach)
    -----------------------
    ri!index Number(Integer)
    ri!guestArray (Date Array)

    =a!dateField(
    label: if(ri!index=1, "Guest Names", ""),
    refreshAfter: "KEYPRESS",
    value: ri!guestArray[ri!index],
    saveInto: a!save(ri!guestArray, rule!dynamicFieldsUpdateArray(ri!index, ri!guestArray, save!value))
    )
              
    Nested Rule (dynamicFieldsUpdateArray)
    --------------------------------------
    ri!index Number(Integer)
    ri!guestArray (Date Array)
    ri!newValue (Date)

    = with(
    local!newGuestList: updatearray(
    ri!guestArray,
    ri!index,
    ri!newValue
    ),
    if(
    isnull(
    local!newGuestList[count(
    local!newGuestList
    )]
    ),
    local!newGuestList,
    append(
    local!newGuestList,
    ""
    )
    )
    )
              


  • Hi pavithrac

    Thanx for replying!! My requirement is fulfilled.
    However the irony is i also used the same code which you have sent me but I got an error...
    Don't know what went wrong but now thanks to your code, it's working fine!!