Add
more contacts after company insert
In this section of the tutorial, you will learn how to configure the
newly created insert page (insertcomcon), so
that you can decide if you want to add more contacts after the submit
or not.
To accomplish this, you will need a way for the user to pass his decision
(a menu, radio-button, checkbox), and a way to redirect
to a specific page based on a condition. As for the passing the decision
part, there is no problem, only the choice of the HTML form elements remains.
For the conditional redirect action, however, you would have some hand-coding
to do.
has this need covered
too, however, through the .
As all the other triggers,
this one can be turned into a conditional trigger, simply by using the
expression builder on the advanced tab.
To add this functionality, you will have to alter the design of the
insert page (e.g. insertcomcon), and only then
add the application logic that performs the actual task.
Alter the page design
This alteration concerns adding a new form element, so that the user
option of whether to add some more contacts or not can be passed to the
trigger. The simplest of elements that can be used effectively is a checkbox.
To change the design, follow the next steps:
- Click on the last row that contains a text box. If
you haven't removed any fields in the wizard configuration, it should
be the row containing the birthday field.
- Add a new row below the current selection. To do
this, right-click in the cell and select -> . Click
on in the dialog box that opens.
- In the new row,type in the first cell "" (without the quotes) as
a label for the checkbox.
- Click in the second cell. Here is where you will
insert the checkbox. Add it from the tab
of the bar, by clicking on its button.
Configure the checkbox, by changing its name to ""
and set the Checked value field to . Also, leave the Initial
state on the setting.

- Now
the checkbox appears on page, but to ease future work you should add it
to the panel. Click on the button of the
panel and select .
Note: For ASP users, you should select the type, then in the dialog box select Request.Form from
the drop down menu.
- Enter the checkbox name in the dialog box's text
field: . Click on
to add the new variable to the environment.

- These are all the changes you will make in the page
design. Save the page, and proceed to adding the trigger for the redirect
operation.
Add application logic
The actual operation will be based on the trigger, which will be set to start on a custom condition:
that the Add more contacts checkbox is checked.
To add and configure the redirect trigger, follow the instructions below:
- Click on the
button of the tab, and
select . This will open the redirect trigger dialog box.
- For this trigger you will have to set options both
for the and
tab. On the tab, just enter the page
to which the user will be redirected. Either enter its name, or use the
button to locate the insert
page in the contact folder.

- Move
on to the tab, where you can define
a starting condition for the redirect. You can either write the condition
in the text-field, or use the condition builder, by pressing the button. Let's use the latter.

- The offers
an easy way to create starting conditions that use two or more terms,
and an operator. Its dialog box is divided into two tabs: ,
where you can define a simple condition based on two terms and the default
operators, and , where you can enter
more complex conditions in a text-area. Since in this tutorial you'll
only need to compare if the variable
has been checked, the tab will suffice.
- It's time to build the actual condition. Follow the
instructions below to construct it:
· For the
first term you will use the
defined when you've added the checkbox into the
page. Click on the blue lightning bolt icon to open 's
dynamic data
selector. Here, select the Form
Variable.
· Click on
and notice that a dynamic construct has
been added into the first element's text field.
· Next comes
the operator. From the drop-down list select ""
to check for equality.
· For the
second operator, you will use an entered value. Since the property for the checkbox has been set to 1, this
is the value that the condition should use. This way, if the trigger's
condition that the checkbox value equals 1 is true, the redirect will
take place. Otherwise, the default redirect of the insert operation (to
the main index) will execute.

· Click on
the button to accept the condition. The
expression will be displayed in the trigger's tab, in the
Condition text field:

- Now the trigger configuration is finished, and you
can click on the button to add the trigger
into the page. Then you can save it, upload it on the server and test
it in the browser.
When you add a company through this insert form, if the Add
more contacts checkbox is checked, when submitting the page, you
will be taken to the contact insert page, where
you can continue adding entries:

In the next topic of the
tutorial you will create a page that will automatically send birthday
greetings to your contacts.