your database front-end

Server Outage Notice: dbFront.com will be transfering to a new Server on Friday 25th @ 7pm MST

Buttons in Action

This is a quick tutorial showing how easy it is to create Action Buttons in dbFront.  You can go to the Action Button knowledge base article to get more detailed instructions.

Transcript

In this tutorial we will create three different action buttons:

  • The first button will set a row value,
  • The second button will run a procedure, and
  • The third button will open a URL.

The first thing we need to do is create place holders for the buttons.   This is done from the Table Preferences dialog.

In the Table Preferences we switch to the Action Buttons tab and quickly create three buttons named:

  • Discontinue Product,
  • Calculate Profit, and
  • Google Item

Once you save the Table Preferences you will notice that you can now see three new disabled buttons.  The buttons are disabled because their setup is not yet complete.

Set Value Button

We will first open the preferences on the "Discontinue" button by clicking on the gear icon.

On the "Main" tab we will set the following:

  • Action Type: Set Value,
  • Refresh Level: None,
  • Success Message: Product Discontinued.

Once you select an Action Type, a new tab will appear asking for more detail relevant to that action.

On the "Set Value" tab we will set the following:

  • Field: DiscontinuedDate,
  • Value: {date()},
  • Visibility: If Null.

One thing that makes the Set Value action button unique is that it can hide or show itself depending upon whether or not it is needed.  The Visibility drop-down allows us to choose the condition under which this button will be visible.  This way you can avoid cluttering up the interface with buttons that are not relevant for the current record.  One exception is that Admin users might need to update the button preferences so for them the buttons need to remain visible but they will become disabled as needed.

Now we save our changes.

As we move through existing records you can see that the Discontinue button becomes enabled or disabled depending upon the product we are viewing.  If the discontinued date is populated then the button will become disabled.

When you click on the button you notice that the Discontinued Date is quickly populated, the message appears and the details and even the table grid automatically update.  Although the refresh level was set at None, dbFront recognized that it needed to update these elements.

Run Procedure Button

Now we open the preferences on the "Calculate Profit" button.

On the "Main" tab we will set the following:

  • Action Type: Run Procedure,
  • Refresh Level: None,
  • Success Message: Profit Calculation Finished.

On the "Procedure" tab we will set the following:

  • Procedure: spCalculateProductProfitability,
  • Parameters: ProductId

It is important to get the procedure name and the number of parameters and the parameter order correct.

Now we save our changes.

When we click on the button you notice that the Profitability field is populated and the success message appears.   In this case, the procedure was very trivial but database procedures can be very complex and perform a wide variety of operations. 

Open URL Button

Finally we open the preferences on the "Google Item" button.

On the "Main" tab we will set the following:

  • Action Type: Open URL,
  • Refresh Level: None.

On the "Open URL" tab we will set the following:

  • URL: http://www.google.com/custom?q={0}&btnG=Search
  • Destination: Dialog,
  • Parameters: Name

In this case, dbFront will insert the parameters into the URL at the position you specify.  The place markers are the parameter number in curly brackets.

Although we chose "Dialog" as the destination, we can leave the height and width blank and dbFront will attempt to pick a reasonable dialog size.

Now we save our changes.

When you click on the button you see a new dialog appear with the Google search results inside.

The OpenURL Button is unique in that it allows you to take advantage of any other web-based resource you can access or build.  This could be a custom page on your internal CMS, a Bing Map search, or even a custom form or report.

Thank you for watching.

Content you want the user to see goes here.
close