How to save multiple Local! variables to rule inputs with record type ri!record.Recordtype

Hi all

I am able to save a local variable defined in an interface into a ri! in the submit button

buttons: a!buttonLayout(
      primaryButtons: {
        a!buttonWidget(
          label: "Submit Request",
          value: local!hiringmanager,
          saveinto: {
           
          ri!record['recordType!NJW NewJoiner.fields.hiringmanager']

          },
          submit: true,
          style: "PRIMARY"
        )

How is the syntax to do the same for multiple local variables that have to be saved into some ri!record.Recordtype.field

any suggestions really appreciated

thank you

Cate

  Discussion posts and replies are publicly visible

  • Thank you very useful. However in the documentation is never shows an example where it saves in a ri!

    For completeness I solved with this syntax and also I noticed that the value is being saved without need of a saveinto with the addition of save! whereas the other local variables require the a!save

     

     buttons: a!buttonLayout(
    
          primaryButtons: {
    
            a!buttonWidget(
    
              label: "Submit Request",
    
              value: local!hiringmanager,
    
              saveinto: {
    
                ri!record['recordType!NJW NewJoiner.fields.hiringmanager'],
    
               a!save( 
    
                 target:ri!record['recordType!NJW NewJoiner.fields.addedby'],
    
                 value:local!AddedBy),
    
                
    
             a!save(
    
               target:ri!record['recordType!NJW NewJoiner.fields.businessmanagerapprover'],
    
               value: local!HMs_Manager),
    
              
    
               a!save(
    
                 target:ri!record['recordType!NJW NewJoiner.fieldsaddedon'],
    
                 value:local!AddedOn)
    
              },
    
              submit: true,
    
              style: "PRIMARY"
    
              )
    
           
    
          }
    
          ,

  • 0
    Certified Lead Developer
    in reply to catev8891

    As the documentation describes, by default, a component saves its value into one or more variables or rule inputs liste in saveInto. In case you want to store other values, you need to use a!save().