Skip to main content
May 20, 2024
Question

Issue creating new record in interface

  • May 20, 2024
  • 1 reply
  • 0 views

Hi. I am having issues creating a new recordType with the below code in a editable grid.

Things of note

1. mouId is a foreign key in the record.

2.The primary key id is set to autogenerate.

addRowlink: a!dynamicLink(
          label: "Add Risk",
          saveInto: {
            a!save(local!data, append(local!data, 'recordType!{3575b740-8740-41f7-83b5-1f1ed66f6a1a}DSC01_Risk'(mouId:ri!mouId,updatedOn:today(), updatedBy:loggedInUser())))
          }
        ),

Error code:

"Interface Definition: Expression evaluation error [evaluation ID = 8DQ5R] : An error occurred while executing a save:

Expression evaluation error at function 'append' parameter 2 [line 116]: Keys must be record field references or record relationship references"

1 reply

konduruc733182
May 21, 2024

When you are adding the mouId and other fields, you need to use the record field reference i.e., recordType!recrdName.field.fieldName


recordType!Case(
   recordType!Case.fields.id: 1,
   recordType!Case.fields.status: "Open",
   recordType!issueType: "Shipping"
)

/*should be something of this format*/