Skip to main content
skender.kollcaku
Employee
Nov 30, 2022 4:43 PM UTC
Solved

What's the best choice to save loading date/time of an interface?

Hi everyone,

For audit purposes in a ticket management process, I need to track create/update/delete actions on a Ticket (record type) each time it has been opened the relative interface and track timing (basically: startEvent, endEvent).
I already track the interface initial loaded date/time in a local variable using now(), but how to pass it to a rule input (and therefore use it in the create/update process)? I think I have to use a!save in the primary button, but I am missing low-code details.

Do you have any suggestion?
Thank you so much,

mikes0011
mikes0011Answer
Brainy
Nov 30, 2022 4:48 PM UTC

What are you trying to save it into?

If you have a field in a CDT you're writing, you would just do an a!save() like you said, as in like, "a!save(ri!myCdt.createdDateTime, local!loadingTime)".

The Expression Guru

8 replies

stefanhelzle0001
Brainy
Nov 30, 2022 4:48 PM UTC

Your button has a saveInto parameter which takes a list of a!save() to be executed as the button is clicked. Now you can store any values in your rule inputs.

skender.kollcaku
Employee
Nov 30, 2022 6:11 PM UTC

Thank you also Stefan! Both suggestions were right as they were the same. ;)

mikes0011
mikes0011Answer
Brainy
Nov 30, 2022 4:48 PM UTC

What are you trying to save it into?

If you have a field in a CDT you're writing, you would just do an a!save() like you said, as in like, "a!save(ri!myCdt.createdDateTime, local!loadingTime)".

The Expression Guru
skender.kollcaku
Employee
Nov 30, 2022 5:04 PM UTC

Thank you for your immediate help.

Here I share the "Create Ticket" interface primary button configuration:

a!buttonWidget(
        label: "Create",
        submit: true,
        style: "PRIMARY",
        value: local!intLoadTime,
        saveInto: { a!save(ri!loadTime, local!intLoadTime) }
      )


where loadTime is a Date/time rule input and the local!intLoadTime has been initialized at the beginning of the form with now().

Was it what you meant?

mikes0011
Brainy
Nov 30, 2022 5:33 PM UTC

ri!loadTime is.. a boolean?

You will need to change that RI to dateTime type, if you want this to do anything useful.

The Expression Guru