Skip to main content
Inspiring
February 26, 2021
Solved

a!buttonWidget to execute various functions

  • February 26, 2021
  • 6 replies
  • 0 views

Hello, 

When I press a button right now it generates a excel file but I want at the same time to generate the excel file and also execute stored procedure, is there such a way, with one click of the button ?

a!buttonArrayLayout(
a!buttonWidget(
label: "Excel",
saveInto: {
a!exportDataStoreEntityToExcel(
entity: cons!BBO_OpportunitiesReportExcelDataStore,
documentName: "Excel Export " & now(),
saveInFolder: cons!BBO_ReportsFolderPointer,
onSuccess: a!save(
local!exportDocId,
fv!newDocument,
),
/*This displays an error if there is an issue executing the the save*/
onError: a!save(
local!errorMessage,
"Error Exporting File to Excel"
)
),
a!save(
local!staussave,
true
),
}
)
)

And this is the stored procedute code: 

executestoredprocedure(
dataSourceName: "jdbc/Appian",
procedureName: "deleteOppExcelData"
),

    Best answer by stefanhelzle0001

    Why not just start a process and do anything you like? a!startProcess()

    6 replies

    stefanhelzle0001
    Brainy
    February 26, 2021

    Why not just start a process and do anything you like? a!startProcess()

    Inspiring
    February 26, 2021

    because it is the same process as the other case earlier, In the process I can generate the file and everything but does not have an option to download it after. Process is not returning  generated file ID to be used in download link. 

    stefanhelzle0001
    Brainy
    February 26, 2021

    Did you enable chaining in the process model? If you chain up to the node which creates the file, this value will be available inside onSucess.