Skip to main content
Inspiring
Feb 26, 2021 5:45 PM UTC
Solved

a!buttonWidget to execute various functions

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"
),

    stefanhelzle0001
    Brainy
    Feb 26, 2021 6:01 PM UTC

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

    6 replies

    stefanhelzle0001
    Brainy
    Feb 26, 2021 6:01 PM UTC

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

    Inspiring
    Feb 26, 2021 6:03 PM UTC

    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
    Feb 26, 2021 6:13 PM UTC

    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.