Error saving to variable in load

I have a variable in a SAIL form that needs to be updated whenever a row is selected in a grid (call this local!dataSelected_name).  This then needs to be passed into another SAIL form where the user can alter the value and save it.

The issue I have is that an error is thrown saying the variable must be a load variable, but it needs to be updated when a user takes an action on the form (so I created it as a with variable).

Any ideas?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    If you're going to be having users or on-form actions do manual updates to the value of a local variable, the variable should in fact be declared as a load() variable. It of course requires a somewhat different design approach to with() variables which are updated 'live', but strictly automatically and in accordance with the initial definition.

    In your case, if you need the variable to be updated whenever (for example) the user interacts with a grid, then you will want to use a!save() in the saveInto section of the grid to set whatever value is necessary. Likewise with any other fields on the form that would cause its value to update when interacted with.
Reply
  • 0
    Certified Lead Developer
    If you're going to be having users or on-form actions do manual updates to the value of a local variable, the variable should in fact be declared as a load() variable. It of course requires a somewhat different design approach to with() variables which are updated 'live', but strictly automatically and in accordance with the initial definition.

    In your case, if you need the variable to be updated whenever (for example) the user interacts with a grid, then you will want to use a!save() in the saveInto section of the grid to set whatever value is necessary. Likewise with any other fields on the form that would cause its value to update when interacted with.
Children