When to set values of a rule input which are hidden to a user?

Certified Associate Developer

Assume I have a form which saves many parameters into a rule input myDataDict of a custom data type with different entries, let's say myDataDict.name (required field) and myDataDict.common is directly visible on my interface. However, in addition to the visible things, I want to automatically populate myDataDict.timestamp with the date-time when the submit-button is pressed.

How do I do that in the most standard way? Where do I have to place my a!save()-call? Inside my a!buttonWidget() ?

  Discussion posts and replies are publicly visible

Parents Reply
  • You can also save as many fields as you need to using an array. For instance, 

    a!buttonWidget(
      label: "Submit",
      submit: true,
      style: "PRIMARY",
      saveInto: {
        a!save(
          target: ri!customer.updatedOn,
          value: now()
        ),
        a!save(
          target: ri!customer.updatedBy,
          value: loggedInUser()
        ),
        a!save(
          target: ri!cancel,
          value: false
        )
      }
    )

    I always prefer using this method of saving data on the button because you can guarantee that all the other data has been entered - otherwise, the user wouldn't be able to submit the form!

Children
No Data