Cubic Compass Software

- Support Wiki

This article will explain the use of Dialogue Script to create custom user registration forms.


Setting up the Dialogue Script Control

Once we are in the edit mode of the Dialogue Script Control, entered by clicking the "pencil" icon, we can start building the Registration Form.
The first thing we need to do is click the "Settings" button in the Dialogue Script Control and set the form's functionality. We will need to check the box for "This form handles click events", set the "Registration" radio button to "Web to Contact", and check the box for "Authenticate User on Submit".

We may also want to designate a landing page for registered users to be redirected once registering. This may be the login screen, or a thank you page informing the user of next steps. To do this, simply select the checkbox for "Redirect On Successful Submit" and enter the alias/URL of the destination page.


Creating the appropriate fields

We now need to create the fields for the user to enter upon registration. For this we will be utilizing the Dialogue Script TextBox Control.

Standard fields for a Registration page are First Name, Last Name, Email Address, and Password. We will also need to add a Submit Button using the Dialogue Script Button Control.
            <td>First Name</td>
            <td><dlog:TextBox id="FirstNameTxt" fieldname="FirstName" /></td>
            <td>Last Name</td>
            <td><dlog:TextBox id="LastNameTxt" fieldname="LastName" /></td>
            <td>Email Address (Login Name)</td>
            <td><dlog:TextBox id="EmailTxt" fieldname="Email" /></td>
            <td><dlog:TextBox id="PasswordTxt" fieldname="password" TextMode="password" /></td>
            <td><dlog:Button id="SubmitBtn" Text="Submit" /></td>

Notice the TextMode="password" attribute on the password textbox. This causes the contents of this field to be replaced with character placeholders.

More fields may be added and mapped to the Salesforce Contact record, such as Phone Number or perhaps a custom field.
After clicking "Save" the form is now complete and should be functional.


Dynamically Adding Web Roles

Web roles can be added to a user during the registration process using a hidden field with the id of "Roles". This can be either hard coded or dynamic.

A Hard Coded example would be as follows:
<dlog:HiddenField id="Roles" value="Customer" />

This can also be dynamically generated with a Python script as follows:
<dlog:HiddenField id="Roles" />
if Page.IsPostBack == True and Selection.Value == "Customer":
     Roles.Value = "Customer"
elif Page.IsPostBack == True and Selection.Value == "Dealer":
     Roles.Value = "Dealer"

ScrewTurn Wiki version 2.0.35. Some of the icons created by FamFamFam.