Skip to main content
December 20, 2024
Question

Unable to add a file component to editable grid row

  • December 20, 2024
  • 3 replies
  • 0 views

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

December 20, 2024

    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
December 20, 2024

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

mikes0011
Brainy
December 20, 2024

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.