Tech Tip: Calling a Date Dialog From a Method

Tech Tip: Calling a Date Dialog From a Method

Collecting date/time input from the user on a form is as simple as adding a Date field to your Aras form. But what if you need to query the user for input during the execution of method code? The Call Date Dialog project on the Aras Labs GitHub page addresses exactly that scenario.

Getting Started

You can find all of the code and files for this demonstration on the Aras Labs GitHub page in the call-date-dialog project. If you want to install the project and follow along, the project page includes all of the instructions for installing the import package.

ArasLabs/call-date-dialog

call-date-dialog - Demonstrates how to call a datepicker dialog from method code.

How the Project Works

Calling Date Dialog From Method Code

Calling Date Dialog From Method Code

The project's import package contains a Javascript method - labs_CallDateDialog. This method calls a datepicker dialog and then executes a custom callback function with the selected date as a parameter. The callback function in this sample code simply displays the date parameter in a browser alert, but you could use the same approach to perform some other business logic with the selected date.

Here's the method code:

LOOKING FOR MORE ARAS INSPIRATION?

Subscribe to our blog and follow @ArasLabs on Twitter for more helpful content! You can also find our latest open-source projects and sample code on the Aras Labs GitHub page.