On Single Click Download The Document and Write record in DB

Hi Everyone,

Is there any way to Download the document and Write operation into Data Base on One Link[One Click Event] from User Interface level.

We are working on 18.2.

Thanks In Advance!!

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    I would prefer to store the button action on interface level, and in process model you can save the data as well as create a link for export file . and rel-loop back to the same user input task again. something similar we have done in below screenshot. Also with this approach process model give you the more flexibility .
  • : Thanks for the response, How will generate the Link in PM? . I didn't find any screenshot.
    Thanks!!
  • 0
    Certified Lead Developer
    in reply to Venkatesh Suram

    Below is the screenshot. So in below scenario When user clicks on 'Generate Export File' Button , we save the button action  in process variable and submit the form. once submitted base on the button action we have some database write logic and some document generation code . once the document is generated reloop to the same form and show the link to generated document using a!linkField

  • Thanks For The response  

    In My scenario no need to generate a new document , I have already document . When user clicks on the link he should able to  download and write the operation into data base.

    In my use case instead of looping the same form we can work with link field, Please find below sample code.

    load(
      local!isShowDocument:false(),
    {
      a!linkField(
        label: "",
        labelPosition: "ABOVE",
        links: {
          a!dynamicLink(
            label:"Show Document",
            value:true(),
            saveInto: {
             local!isShowDocument,
            /*We can perform the Write Operation here*/
           /* a!writeToDataStoreEntity(
              
            )*/
            },
            showWhen:not(local!isShowDocument)
          ),
          a!documentDownloadLink(
            label:"Download Document",
            document:todocument(12345),
            showWhen:local!isShowDocument
          )
        }
      )
    }
    )

    Same thing suggested by Shanmukha (raghavendrar0001), But here we need to assume once user clicks on the show Document label downloaded the document irrespective of the download action.

Reply
  • Thanks For The response  

    In My scenario no need to generate a new document , I have already document . When user clicks on the link he should able to  download and write the operation into data base.

    In my use case instead of looping the same form we can work with link field, Please find below sample code.

    load(
      local!isShowDocument:false(),
    {
      a!linkField(
        label: "",
        labelPosition: "ABOVE",
        links: {
          a!dynamicLink(
            label:"Show Document",
            value:true(),
            saveInto: {
             local!isShowDocument,
            /*We can perform the Write Operation here*/
           /* a!writeToDataStoreEntity(
              
            )*/
            },
            showWhen:not(local!isShowDocument)
          ),
          a!documentDownloadLink(
            label:"Download Document",
            document:todocument(12345),
            showWhen:local!isShowDocument
          )
        }
      )
    }
    )

    Same thing suggested by Shanmukha (raghavendrar0001), But here we need to assume once user clicks on the show Document label downloaded the document irrespective of the download action.

Children
No Data