Hi
So basically, i have a record type for " Requests" and i have another record type for "Documents ", In the "Add or Create Request" Interface, which was generated by record action, I should include a section for "Adding Documents", except that adding a document should be done by an editable grid and not record action.
I have the following code for the document editable grid, but when i link it to the document error I keep getting the error shown in the image below.
what is the right way to link the editable grid to the document record type?
,
a!gridLayout( totalCount: count(local!document), headerCells: { a!gridLayoutHeaderCell(label: "Document" ), a!gridLayoutHeaderCell(label: "Name" ), a!gridLayoutHeaderCell(label: "Classification" ), a!gridLayoutHeaderCell(label: "Uploaded By" ), a!gridLayoutHeaderCell(label: "Uploaded On" ) }, columnConfigs: { a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ), a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ), a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ), a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ), a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:2 ) }, rows: a!forEach( items: local!document, expression: a!gridRowLayout( id: fv!index, contents: { a!fileUploadField( target: cons!SKJ_DOCUMENTS_FOLDER, maxSelections: 1, value: local!doc, saveInto: {local!doc a!save(fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{6d510991-df65-4ae0-a9b9-179a36931fb0}docId'],document(documentId: local!doc, property: "id")) }, buttonDisplay:"ICON",buttonStyle: "STANDARD"), a!textField( value: fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{f65ae4e8-afd3-4a5a-80c7-3c67d225a274}docName'], saveInto: fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{f65ae4e8-afd3-4a5a-80c7-3c67d225a274}docName'], required:true ), a!textField( value: fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{a3f411dd-394e-4039-a2d0-600d333f94b0}classification'], saveInto: fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{a3f411dd-394e-4039-a2d0-600d333f94b0}classification'], required:true ), a!textField( value: fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{66325d17-158b-4776-98b3-761a5a458e5c}addedBy'], saveInto: fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{66325d17-158b-4776-98b3-761a5a458e5c}addedBy'], required:true ), a!textField( value: fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{1fc16e35-b769-46b0-8d9e-9dc633cbb090}addedOn'], saveInto: fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{1fc16e35-b769-46b0-8d9e-9dc633cbb090}addedOn'], required:true ) } ) ), addRowlink: a!dynamicLink( label: "Add Document", value: { startDate: today() + 1 }, saveInto: { a!save(local!document, append(local!document, save!value)) } ), rowHeader: 1 ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: if(ri!isUpdate, "Save", "Create"), saveInto: { a!save(ri!record['recordType!{2206daff-ddbb-4759-a797-1588754c3925}SKJ Deposit Request.fields.{5235c1d0-b6e1-46c6-9220-76297f113533}addedBy'],loggedInUser()), a!save(ri!record['recordType!{2206daff-ddbb-4759-a797-1588754c3925}SKJ Deposit Request.fields.{d1ddd575-4a1e-4d4c-b42a-0137bd6d4fc6}addedOn'],now()), a!save( ri!record['recordType!{2206daff-ddbb-4759-a797-1588754c3925}SKJ Deposit Request.fields.{a73185b2-bd7e-48d0-8b42-8371f10582d7}updatedBy'],loggedInUser()), a!save( ri!record['recordType!{2206daff-ddbb-4759-a797-1588754c3925}SKJ Deposit Request.fields.{daca2072-8868-4326-8a19-e3ce69ef9dc6}updatedOn'], now()) }, submit: true, style: "PRIMARY", validate: true ) }, secondaryButtons: { a!buttonWidget( label: "Cancel", value: true, saveInto: ri!cancel, submit: true, style: "NORMAL", validate: false ) } ) ) )
Discussion posts and replies are publicly visible
I think the problem is, that you add a dictionary to that list, but then user record type syntax to save to that item. You need to change the value of that "Add Document" to be of a record type.
Hello,If that's the exact code, then you are missing a comma after local!doc (line 27). Maybe the local!doc may contain multiple values, which breaks on saving.Try to take only one value for local!doc and then save it.