How to store the value in rule input if value and saveInto are not having same values.

I want to store the value of 'Monitoring Day' text field into rule input. Please find the below code I am using:

a!textField(
label: "Monitoring Day",
labelPosition: "ABOVE",
value: text(ri!monitoringDate,"dddd"),
saveInto: a!save(ri!monitoringDetails.monitoringDay,save!value),
showWhen: not(isnull(ri!monitoringDate)),
required: false,
readOnly: true,
validations: {}
),

It is not storing value in ri!MonitoringDay.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    2 things:

    1. for a simple SaveInto, you don't need to use a!save() unless you're trying to save a value different from the value parameter of the component.  In other words, here you could just type "saveInto: ri!monitoringDetails.monitoringDay"
    2. I see you have "readOnly" set to a value of true.  This means no user interaction will be possible on this text field, meaning that nothing in the saveInto parameter will ever execute.  Can you tell us a bit more about the use case that you would be trying to use this for?
Reply
  • 0
    Certified Lead Developer

    2 things:

    1. for a simple SaveInto, you don't need to use a!save() unless you're trying to save a value different from the value parameter of the component.  In other words, here you could just type "saveInto: ri!monitoringDetails.monitoringDay"
    2. I see you have "readOnly" set to a value of true.  This means no user interaction will be possible on this text field, meaning that nothing in the saveInto parameter will ever execute.  Can you tell us a bit more about the use case that you would be trying to use this for?
Children