Skip to main content
Known Participant
Dec 20, 2024 8:21 PM UTC
Question

Unable to add a file component to editable grid row

How am I supposed to on a addRowLink, add an empty document file to my list of documents files?

The thing is: on a interface, the fileUploadField is working, but it doesn't work on the site

    addRowlink: a!dynamicLink(
      label: "Inserir novo documento",
      /*value: { id: null, doc: "", tipo: "", descricao: "" },*/
      value: 'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta'(
        'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{9edd3c74-2a43-4d35-a34a-f15156e24008}nome': null
      ),
      saveInto: {
        a!save(ri!documents, append(ri!documents, "")),
        a!save(ri!record, append(ri!record, save!value)),
      }
    ),
    rowHeader: 1,
    
  )

3 replies

Known Participant
Dec 20, 2024 8:25 PM UTC

    addRowlink: a!dynamicLink(
      label: "Inserir novo documento",
      /*value: { id: null, doc: "", tipo: "", descricao: "" },*/
      value: 'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta'(
        'recordType!{1f7c4a8e-ee45-44c7-8872-dc5542133555}GC Documento Proposta.fields.{9edd3c74-2a43-4d35-a34a-f15156e24008}nome': null
      ),
      saveInto: {
        a!save(ri!documents, append(ri!documents, "")),
        a!save(ri!record, append(ri!record, save!value)),
      }
    ),
    rowHeader: 1,
    
  )

This works on the interface, but it doesn't on the site

mathieud0001
Genius
Dec 20, 2024 9:17 PM UTC

What doesn't work exactly? The file doesn't upload?

mikes0011
Brainy
Dec 20, 2024 9:26 PM UTC

Why aren't you just storing the document ID in the row of data itself?  Why the separate "ri!documents" array?  That's unnecessarily complicated in most cases.

The Expression Guru