Dialog - Custom
Declaration
<AMSHOWDIALOG ACTIVITY="custom" FILENAME="text" LAYOUT="text" RESULTSTRUCTURE="text" WINDOWTITLE="text" RESULTMETADATA="text" XPOS="number" YPOS="number" />
Description
Displays a custom dialog constructed using the Dialog Designer, an IDE that provides a graphical tool to easily design custom dialogs to be used within a task.
Practical usage
Used to display a custom dialog constructed by the developer. A dialog is a temporary window that appears to retrieve user input. An application typically uses dialoges to prompt the user for additional information or selection from menu items. A custom dialog may be required that, for example, presents the user with specific options, and then runs the appropriate subroutine based on the option they chose. It such cases, the developer may need to create a custom dialog.
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Location of layout | --- | --- | --- | --- | Specifies
the location of the custom dialog layout. This is a graphical
parameter only used during design time, therefore, contains no
properties or markups. The available options are:
|
Layout | Text | Yes, if Location of layout is set to Layout is embedded in task file | (Empty) | LAYOUT=[Embedded] | The custom layout is embedded within the task. This parameter is active only if the Location of layout parameter is set to Layout is embedded in task file. To create or edit the custom dialog, click Edit Layout. See Dialog Designer for more details. |
Filename | Text | Yes, if Location of layout is set to Layout is located in an external file | (Empty) | FILENAME="c:\temp\layout.xml" | The path and file name of the custom layout saved externally. This parameter is active only if the Location of layout parameter is set to is set to Layout is located in an external file. Click the folder icon to navigate to the to the external .xml file. To edit the custom layout, click Edit Layout. See Dialog Designer for more details. |
Create and populate dialog data | Text | Yes | (Empty) | RESULTSTRUCTURE="theStructure" | The name of the dataset to create and populate with dialog data. This dataset will include the values for the various controls of the dialog, including any dynamic values that were selected by the user (if any). The complete list can be viewed from the Variables Debug Window. |
Create and populate dialog metadata | Text | No | (Empty) | RESULTMETADATA="theMetadata" | The name of the dataset to create and populate with dialog metadata. This dataset will include the values for the various dialog controls, including any dynamic values that were selected by the user (if any). The complete list can be viewed from the Variables Debug Window. |
Title | Text | No | MyDialog | WINDOWTITLE="MyDialog2" | The title of the custom dialog. This title will appear in the title bar when the dialog opens. |
Bring dialog to front | Yes/No | No | Yes | WINDOWINFRONT="NO" | If selected, at runtime, the dialog will appear in front of other open windows. If disabled, it will appear behind other open windows (assuming other windows are currently displayed). |
Advanced
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Position | Text (Options) | No | Center of screen | POSITION="lower_right" | Specifies
the screen position that the custom dialog will be displayed.
The available options are:
|
Window coordinates (X) | Number | Yes if Position parameter is set to Custom location | --- | XPOS="3335" | The X window coordinate relative to the screen. To capture a position using the mouse, enable the option Capture mouse position below. |
Window coordinates (Y) |
|
Yes if Position parameter is set to Custom location | --- | YPOS="772" | The X window coordinate relative to the screen. To capture a position using the mouse, enable the option Capture mouse position below. |
Capture mouse position (press Space to capture) | --- | --- | --- | --- | If enabled, allows the screen position to be captured by the mouse. To capture a specific area on your screen, hover the cursor over the desired position and press the Space bar on your keyboard. This will automatically populate the X and Y window coordinates. |
Example
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Description
This sample task presents a custom dialog prompting the user to select a date. A second dialog displays the date selected by the user.
<AMSHOWDIALOG ACTIVITY="custom" RESULTSTRUCTURE="dialog_data" WINDOWTITLE="TheDialog" RESULTMETADATA="dialog_metadata"><AutoMateDialogDesigner><Property name="ErrorCaption">FormDesigner</Property><Property name="AutoAlignAid">SnapToGrid</Property><Property name="DesignerContextMenu">False</Property><Property name="AutoScroll">False</Property><Property name="AutoScrollMargin">0,0</Property><Property name="AutoScrollMinSize">0,0</Property><Property name="AccessibleDescription"/><Property name="AccessibleName"/> <Property name="AccessibleRole">Default</Property><Property name="AllowDrop">False</Property><Property name="AutoScrollOffset">0,0</Property><Property name="BackColor">GradientInactiveCaption</Property><Property name="BackgroundImageLayout">Tile</Property><Property name="CausesValidation">True</Property>/><Property name="Controls"><Object type="System.Windows.Forms.DateTimePicker,System.Windows.Forms,Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="DateTimePicker1"><Property name="DataBindings"><Property name="DefaultDataSourceUpdateMode">OnValidation</Property></Property><Property name="Location">16, 56</Property><Property name="Name">DateTimePicker1</Property><Property name="Size">336, 32</Property><Property name="TabIndex">2</Property></Object><Object type="System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="Label1"><Property name="ImageAlign">TopCenter</Property><Property name="Text">Please select a date from the calendar below.</Property><Property name="UseCompatibleTextRendering">True</Property><Property name="BackColor">GradientInactiveCaption</Property><Property name="Cursor">Default</Property><Property name="DataBindings"><Property name="DefaultDataSourceUpdateMode">OnValidation</Property></Property><Property name="Font">Segoe UI, 14pt</Property><Property name="ForeColor">ControlText</Property><Property name="Location">0, 8</Property><Property name="Name">Label1</Property><Property name="RightToLeft">No</Property><Property name="Size">472, 24</Property><Property name="TabIndex">1</Property></Object></Property><Property name="Cursor">Default</Property><Property name="DataBindings"><Property name="DefaultDataSourceUpdateMode">OnValidation</Property></Property><Property name="Font">Segoe UI, 14pt</Property><Property name="ForeColor">ControlText</Property><Property name="Location">0, 0</Property><Property name="Margin">3, 3, 3, 3</Property><Property name="MaximumSize">0, 0</Property><Property name="MinimumSize">0, 0</Property><Property name="RightToLeft">No</Property><Property name="Size">484, 326</Property><Property name="Tag"/><Property name="Text"></Property><Property name="UseWaitCursor">False</Property><Property name="Padding">0, 0, 0, 0</Property><Property name="ImeMode">NoControl</Property><CustomProperties><Property name="HostFormLocation">0, 0</Property><Property name="HostFormSize">500, 400</Property></CustomProperties></AutoMateDialogDesigner></AMSHOWDIALOG>
<AMSHOWDIALOG>The selected date is:%dialog_data.DateTimePicker1.Value%</AMSHOWDIALOG>