I'm flummoxed. How to Begin the Tasks?

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I'm flummoxed. How to Begin the Tasks?

Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,264 Points 20k badge 2x thumb

Posted 4 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,264 Points 20k badge 2x thumb
I have been flummoxed as well as How to Begin the Tasks.js until I heard the old Crosby, Stills, Nash & Young song this morning:

So Begins The Tasks.js

The essential question is how can your organize your application to conveniently run your scripts that perform some type of administrative or maintenance task against your application. Unfortunately QuickBase does not provide any type of dashboard interface or widget from which you can run scripts from a button click (buttons on the dashboard load pages). This application demonstrates the manner in which I often organize scripts for clients and my own projects.

The application has a table Tasks which has four fields:

[Task Name] text field
[Description] multiline text field
[Script Name] text field
[Button] formula text field

The formula for the [Button] field is as follows:

"<a class='Vibrant Success' " &
"  onclick='$.getScript(gReqAppDBID + \"" & "?a=dbpage&pagename=" & [Script Name] & "\");'" &
">" & [Task Name] & "</a>"

To set up a new task you provide a short name for the task in field [Task Name], a description of the task in the filed [Description], and finally the name of the user defined page in the field [Script Name]. When the [Button] is clicked the script in the user defined page named [Script Name] will execute without reloading the page. Of course you also have to provide the actual script as a user defined page that perform some useful work. 
As example, the demo has three buttons defined each of which has some custom interface (but no actual code the manipulates the application - you will have to provide that):

  1. Do Something - Simply throws up an alert indicating that the DoSomething.js script has executed

  2. Give Us Bacon - Throws up a spinner for five seconds to provide feedback for a hypothetical long running script

  3. Make It So - Throws up a jQueryUI Dialog to collect various parameters that may need to be solicited from the user to implement some specific functionality.

My three scripts are just simple stubs with various user interface mechanisms for feedback and user input:
DoSomething.js https://haversineconsulting.quickbase.com/db/bkjqaqmvv?a=dbpage&pagename=DoSomething.js
GiveUsBacon.js https://haversineconsulting.quickbase.com/db/bkjqaqmvv?a=dbpage&pagename=GiveUsBacon.js
MakeItSo.js https://haversineconsulting.quickbase.com/db/bkjqaqmvv?a=dbpage&pagename=MakeItSo.js
Pastie Database
Attached is a screenshot of the jQueryUI Dialog which many users may find quite useful.