store value to ri!available

I'd like to store the value  ri!available using this code

a!integerField(
label: "Available Racks",
labelPosition: "JUSTIFIED",
value: if(isnull(ri!bicycleInfo.stationId),
"",rule!PEDS_QueryStationStatusInfoByStationId(id: ri!bicycleInfo.stationId).availableRacks
),
saveInto: ri!available,
refreshAfter: "UNFOCUS",
readOnly: true,
validations: {}
)

  Discussion posts and replies are publicly visible

  • 0
    Certified Senior Developer

    we can save value to ri!availble on the action on screen. for eg. let just say saveInto of  integer or text field for stationId 

    a!integerField(
    label: "Station Id",
    labelPosition: "JUSTIFIED",
    value: ri!bicycleInfo.stationId ,

    saveInto: {ri!bicycleInfo.stationId ,

    a!save(ri!available,

    if(isnull(ri!bicycleInfo.stationId),
    "",rule!PEDS_QueryStationStatusInfoByStationId(id: ri!bicycleInfo.stationId).availableRacks
    ))},
    refreshAfter: "UNFOCUS",
    validations: {}
    ),

    a!integerField(
    label: "Available Racks",
    labelPosition: "JUSTIFIED",
    value: ri!available,

    refreshAfter: "UNFOCUS",
    readOnly: true,
    validations: {}
    )

  • 0
    Certified Lead Developer

    The saveInto is only executed on user interaction. Check the documentation for how to set default values.