Skip to content
🚀 Rapid Application Development with the App Builder

onAppOpen ​

When an application is launched, developers can perform custom actions using the onAppClose hook.

Parameters ​

ParameterTypeDescription
loadScriptfunctionSee loadScript(fileName, scriptId)
loadStylefunctionSee loadStyle(fileName, styleId)

Return Value ​

None

✨ Simple Example of a onAppOpen Hook ​

js
((loadScript, loadStyle) => {

    wpda.log.info("Starting products app...")

	// Make sure path exists and is accessible:
	loadScript("/path/my-js-functions.js", "myJsFunctions")
	loadStyle("/path/my-style.css", "myCss")
	
})

✨ Example Setting App Permissions Interactively ​

js
if (!userHasRole("manager")) {
    app.setGlobalSearch(false)
    app.setColumnFilters(false)
    app.setInsert(false)
    app.setUpdate(false)
    app.setDelete(false)
    app.setInlineEditing({
        "email": false,
        "first_name": true,
        "last_name": true,
    })
    app.setBulkActions({
        "pdf": true,
        "xml": false,
        "delete": false,
    })
}

More Examples ​