Generate download link when clicking on button

Certified Senior Developer

Hi there,

I have created a button to generate CSV file but after clicking on button- page redirects to home page. 
I want to create document link when clicking on button so that file get downloaded. How can I do this in interface?

Thanks

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

          a!richTextDisplayField(
            value: a!richTextItem(
              text:"Dowload Document",
              link: a!documentDownloadLink(
                label: document(
                  documentId: if(a!isNotNullOrEmpty(local!docId),null(),local!docId),
                  property: "name"
                ),
                document: if(a!isNotNullOrEmpty(local!docId),null(),local!docId)
              ),
              showWhen: not(a!isNotNullOrEmpty(local!docId))
              )
            ),

    Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function 'document' [line 949]: The passed parameter(s) are of the wrong type. Received the type Text.

Children