Hi , I am building a document upload form after uploading the document it should be populating in the gridfield with the link format where user can download the lfile. but that field is coming as empty. This is my code. The documentId field is text now, we don't have access to edit it now . can changing the datatype will fix the issue or is there anything elseI have to look into?
a!localVariables( local!documentId: null, local!category: null, local!comment: null, local!showUploadSection: false(), local!npdoDocumentList: ri!npdoDocument, a!formLayout( contents: { a!sectionLayout( contents: { a!boxLayout( label: "Supporting Documents", contents: { a!gridField( data: local!npdoDocumentList, columns: { a!gridColumn( label: "Title", value: a!linkField( label: fv!row['recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document.fields.{0c0ce663-8d05-43a5-9c23-92394e8102ec}documentId'], links: a!documentDownloadLink( document: tointeger(fv!row['recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document.fields.{0c0ce663-8d05-43a5-9c23-92394e8102ec}documentId']) ) ) ), a!gridColumn( label: "Category", value: fv!row['recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document.fields.{408a7879-6ab6-45cb-a35e-7330c9caf15e}category'] ), a!gridColumn( label: "Comments", value: fv!row['recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document.fields.{dfc46fd3-86fc-4d85-b663-544b3b9d1031}comment'] ), a!gridColumn( label: "Uploaded On", value: fv!row['recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document.fields.{7481670c-f621-4872-bd46-d6d20909e139}uploadedOn'] ), a!gridColumn( label: "Uploaded By", value: fv!row['recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document.fields.{3ad4e016-cf0f-4bf3-8231-ef8cbf9bed92}uploadedBy'] ), } ) }, style: "INFO", labelSize: "MEDIUM" ) } ), a!sectionLayout( contents: { a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Upload Docs", submit: false, style: "SOLID", icon: "file-upload", saveInto: a!save(local!showUploadSection, true()), showWhen: not(local!showUploadSection) ) } ) } ), a!sectionLayout( contents: { a!boxLayout( label: "Upload Document", contents: { a!fileUploadField( label: "Choose a file", required: true, target: cons!NPDO_REQUEST_DOCUMENTS_FOLDER, maxSelections: 1, value: local!documentId, labelPosition: "ADJACENT", saveInto: local!documentId ), a!dropdownField( choiceLabels: { "New Request", "Miscellaneous" }, choiceValues: { "New Request", "Miscellaneous" }, label: "Category", required: true, labelPosition: "ADJACENT", placeholder: "Document category", value: local!category, saveInto: local!category ), a!paragraphField( label: "Comments", labelPosition: "ADJACENT", required: true, value: local!comment, saveInto: local!comment ) } ) }, showWhen: local!showUploadSection ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Submit", submit: true, style: "SOLID", saveInto: { a!save( local!npdoDocumentList, append( local!npdoDocumentList, 'recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document'( 'recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document.fields.{0c0ce663-8d05-43a5-9c23-92394e8102ec}documentId': local!documentId, 'recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document.fields.{408a7879-6ab6-45cb-a35e-7330c9caf15e}category': local!category, 'recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document.fields.{dfc46fd3-86fc-4d85-b663-544b3b9d1031}comment': local!comment, 'recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document.fields.{13c5c9df-b703-4040-baf4-64a65ffc62f3}uploadedBySOEID': loggedInUser(), 'recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document.fields.{7481670c-f621-4872-bd46-d6d20909e139}uploadedOn': now(), 'recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document.fields.{041e09bf-8b95-4f82-87c6-6289b8c22b57}isActive': 1, 'recordType!{a1b2b5cb-c59b-4595-aff1-2d50b50e490a}NPDO Document.fields.{3ad4e016-cf0f-4bf3-8231-ef8cbf9bed92}uploadedBy': concat(user(loggedInUser(), "firstName")," ",user(loggedInUser(), "lastName")) ) ) ), a!save(ri!npdoDocument,local!npdoDocumentList), a!save(local!documentId, null), a!save(local!category, null), a!save(local!comment, null), a!save(local!showUploadSection, false()) } ) }, secondaryButtons: { a!buttonWidget( label: "Cancel", submit: false, style: "OUTLINE", validate: false, saveInto: { a!save(local!documentId, null), a!save(local!category, null), a!save(local!comment, null), a!save(local!showUploadSection, false()) } ) }, showWhen: local!showUploadSection ) ) )
Discussion posts and replies are publicly visible
Your grid is empty because a!fileUploadField() saves a Document value, but your record field documentId is Text.Changing the record field datatype to Document would also fix it (and is the cleaner option).
in 24.2 we dont have the document datatype . Should changing it to integer work?
Have you tried changing it?
Yes I changed the type but it's still not working