To create a new type of appointment in Diary Planner you'll need to create a new booking form and article, a new appointment Slot Type Template to define the appointment, set up new appointment configuration End Points, and set up the availability of the appointment in the Slot Book Template calendars.
This article assumes you have set up your Diary Planner installation in the same way as the Example Installation
Create the Booking Form
You don't have to create a new form for every type of appointment, it is possible to use the same form for all of them. If you'd like to create a custom form for booking your new appointment type:
- In the forms library find the "Diary Planner Blue Print - appointment" form
- Right-click and choose "Create a form using..."
- Your form name must begin SBCHAINED - this enables the system to find your form when setting up the Slot Type articles
- When the form opens click on the Properties tab and change the parent group to one of your own
- Add any new fields and pages to your form - see the sections at the bottom of this article
- Save and publish your form
Create the Appointment Article
Every type of appointment needs a corresponding article using the Slot Type Template.
- Create an article using the Slot Type template in the "Appointment Types" section of your application
- Set the article heading as the name of your appointment
- Complete the article extras following the guidance in the Slot Type template article
- The "gather data" form is the form you created above (or you can use the default one)
- Set the CTM Template to Default
- Set the CTM application to Diary Planner Example
- Set lookaheads enabled to Yes
- Click submit article
Make a note of the article ID, you will need it when configuring the appointment configuration End Point.
Create the Appointment Configuration End Point
- In the End Point library find the Diary Planner configuration for the current environment (eg prod, test or dev)
- Right click on your application group and create a new group named after your appointment
- Copy the
config.example.DiaryPlanner.ExampleApplication.ExampleAppointment.getConfig End Point and on the Properties tab, move it into your new appointment group - Open the script tab set the
appointmentTypeArticleId to the article ID of your appointment Slot Type article created above - Publish your End Point
Setup Appointment Availability
- Find the calendar (Slot Book Template article) you'd like your new appointment to be booked into
- On the Extra tab find the "Slot Type and Availability" section and set which days you want the appointment to be available on
Create Public Booking Article
Each type of appointment needs its own booking article. Booking articles use the "Forms Service - Diary Planner Appointment" template. In the article extras of this template, pick the application and appointment type - this is how the booking form looks up the correct configuration for the appointment.
- Create an article using the Forms Service - Diary Planner Appointment template
- On the extras tab
- Select your application from the drop down
- Select your appointment from the drop down
- Relate your booking form
- Publish the article
Adding custom fields and pages to your booking form
You are now ready to customise your form to have the exact fields and behaviour that you want. The following field should not be removed or renamed.
Field / variable | Description |
---|---|
DURATION | The duration of the appointment Defaults to config,appoinmentType.default length Used to calculate the appointments that can be offered If creating an appointment with variable duration must be updated with the calculated or entered duration Used by the Slot Booking Process |
TITLE | Captures the title of the person the appointment is for Defaults to blank If creating an appointment where Title is required information can be converted to a drop-down list Used by the Slot Booking Process |
FIRSTNAME | The first name of the person the appointment is for Used by the Slot Booking Process |
LASTNAME | The last name of the person the appointment is for Used by the Slot Booking Process |
CONTACTVALIDATION | Applies validation to ensure that either a phone number, email address or both are provided |
The email address of the person the appointment is for Must be in a valid email address format Used by the Slot Booking Process | |
PHONE | The phone number of the person the appointment is for Must be a valid UK number Used by the Slot Booking Process |
These fields can be moved to other pages in the form but your will have to update all references within the form to target the new location.
Adding a field
- Add the field that you require and set any required validation and handler logic
- Navigate to the Check Your Answers page and select the field CYA
- Click on the edit handlebars button on the template property
- Navigate in the template to the page that has your field
- Copy an existing section
- Update to have the label you want
- Update the
{{FIELD "***"}} to reference your new field - Select your new entry and press CTRL + C to make it available for pasting
- Save your changes
- Click on the Form settings tab in the bottom right hand corner of the Forms Designer
- Scroll until you see the Custom Read Only Property
- Click on the edit handlebars button on this property
- Navigate in the template to the page that has your field
- Use CTRL + P to paste in the code for displaying your field
- Save your changes
- Repeat the above to add any additional fields that you require
Adding a new Page
- Open your appointment form
- Add your new page, it must be before the Select Appointment Page
- Drag on the New Diary Planner Appointment Page snippet
- Open the Check your answers page
- Navigate to the Check Your Answers page and select the field CYA
- Click on the edit handlebars button on the template property
- Navigate in the template to the location of where you want your new page's details displayed
- Add the following section for your new page
<h2></h2>
<table class="icmformdatapagetable">
<tbody>
<tr>
<td colspan="2" class="icmformdatacontainer">YOUR PAGE NAME</td>
</tr>
</tbody>
</table>
{{#if this.editButtons.otherButtons}}
{{SCRIPTBUTTON name="selectAppointment" label="Edit" data="YOURPAGE" onClick="editPage"}}
{{/if}}
- Replace YOUR PAGE NAME with the display name for your new page
- Replace YOURPAGE with the name of the page
- Save your changes
- Click on the Form settings tab in the bottom right hand corner of the Forms Designer
- Scroll until you see the Custom Read Only Property
- Click on the edit handlebars button on this property
- Navigate in the template to where you want your page displayed
- Add the following section
<h2></h2>
<table class="icmformdatapagetable">
<tbody>
<tr>
<td colspan="2" class="icmformdatacontainer">YOUR PAGE NAME</td>
</tr>
</tbody>
</table>
- Replace YOUR PAGE NAME with the display name for your new page
- Add your fields, following the steps outlined in Adding a field (above)