Append empty value to record

I have a record used in an interface and I want, as I press a dynamic link, in the save() part to add an empty vale to the array of the record, to do this I try a!save(recordtype,append(recordtype,save!vale) the save!value is the recordtype(), but it says it doesn't allow appends to records, how do I do it? I don't have much experience with records still.

I need this because I have a foreach with that recordtype as the item so I need a new row when I press the dynamic link so I can fill the fields that should appear

Thank you

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to pedrob0002

    Yeah it does. Here is the same example with local variables.

    a!localVariables(
      local!values,
      {
        a!richTextDisplayField(
          value: a!richTextItem(
            text: "Add user",
            link: a!dynamicLink(
              saveInto: {
                a!save(
                  local!values,
                  append(
                    local!values,
                    'recordType!{SYSTEM_RECORD_TYPE_USER}User'()
                  )
                )
              }
            )
          )
        ),
        if(
          a!isNotNullOrEmpty(local!values),
          a!richTextDisplayField(
            value: a!richTextBulletedList(
              items: local!values['recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_displayName}displayName']
            )
          ),
          {}
        )
      }
    )