Skip to main content
April 12, 2024
Solved

Unable to save array of data to record.

  • April 12, 2024
  • 12 replies
  • 0 views

Hi Team, 

I have a scenario, where I need to add multiple assignees. To do this, I have created a user picker field and initially saving the inputs to a local variable. I want to save this data to a assignees record. where assignees record is in one to many relationship with meeting data record. This mean, the relationship record is multiple in my case and I was not able to save the list of assignees to the record. Can anyone help me?

Attaching the code for reference. 

    Best answer by mikes0011
    trying to save each attendee to different rows in record in "ri!meetinginfo".

    saveInto: {
      a!save(
        ri!meetingInfo,
        a!forEach(
          local!attendee,
          'recordType![meeting]'(
            'recordType![meeting].fields.{attendee}attendee': fv!item
          )
        )
      )
    }

    (you will need to correct the record type / field references since record type references copy/paste as gibberish here)

    12 replies

    April 12, 2024

    [mention:b8ea18cfbb2e4f6d841cf3c1d4d7420b:e9ed411860ed4f2ba0265705b8793d05]  [mention:a11f77a729fb4db2af76b09948583328:e9ed411860ed4f2ba0265705b8793d05]  [mention:b45a4f6a20b14a008e4e0ec732a8bf98:e9ed411860ed4f2ba0265705b8793d05] 

    mikes0011
    Brainy
    April 12, 2024

    why are you trying to call a!save() inside an a!forEach() loop?

    April 12, 2024

    I tried saving all the data in local variable to array of record, so I tried calling in foreach.

    harshk1671
    April 12, 2024