document error

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 ?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    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

Reply
  • 0
    Certified Associate Developer

    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

Children