Skip to main content
sunilc0007
November 16, 2022
Question

document error

  • November 16, 2022
  • 6 replies
  • 0 views

a!formLayout(
  label: "View Document",
  contents: {
    a!sectionLayout(
      contents: {
        a!documentViewerField(
          label: "Document Viewer",
          labelPosition: "ABOVE",
          document: 5080,
          height: "MEDIUM"
        )
      }
    )
  },
  buttons: a!buttonLayout(
    primaryButtons: {
      a!buttonWidget(
        label: "Submit",
        submit: true,
        value: "Submit",
        saveInto: ri!buttonvalue,
        style: "PRIMARY",
        loadingIndicator: true
      )
    },
    secondaryButtons: {
      a!buttonWidget(
        label: "Back",
        submit: true,
        value: "Back",
        saveInto: ri!buttonvalue,
        style: "NORMAL",
        validate: false
      )
    }
  )
)

I want to see the document  in the interface with the help of this code but  I am not able to do this.

Its directly download the document how can I see the document ?

    6 replies

    priyankab0004
    November 16, 2022

    This code is work just use right document to view.

    sunilc0007
    November 16, 2022

    I couldn't found that
    Can you please write it.

    priyankab0004
    November 16, 2022

    what is your requirement just view the document. right

    amans0009
    November 16, 2022

    if the document type that you are accessing is  of excel type then the document viewer field doesn't support it and it automatically downloads the document 
    here are some solutions

     1. you can check if the document is of excel type , if it is then show the download button instead of document viewer field (for user experience)

     2. you can use plug in to change the type of document from excel to pdf etc

    sunilc0007
    November 16, 2022

    Ya its working, because my document type is PDF.