auto_stories Bilgi Bankası chevron_right Form chevron_right Makale

Calendarv5

 

The Xpoda Calendar tool lets you easily view and select dates. With it you can follow your events, browse specific dates or choose dates for different events. 

 

Appearance in ToolboxAppearance in Free FormAppearance in Responsive Form
           

 

Compatibility

Free FormResponsive FormMobile
icons8-check-circle-48.pngicons8-check-circle-48.png

 

blobid0.png

To use this tool you need a calendar edit form that provides the values. The Edit Form must have 'person, start date, end date and title' fields. The mappings in the properties are matched to these fields. 

 

Properties of the Calendar tool: 

 

Type: Shows the field type of the added form tool. This value cannot be changed. 

Name: The default name the component gets after being dragged. You can reach this field in the form by the name in Name. It can be renamed without Turkish characters if desired. There must be no other component with a similar name in the form. 

List users: How the groups the calendar details belong to are shown on the client screen. Choosing vertical or horizontal gives the views shown in the image below. 

In vertical view the user information is on the left and listed downwards. In horizontal view the user information is at the top and listed to the right. 

Horizontal View:  

 

 

Vertical View: 

  

Module and Edit Form: Module lists all modules created in the App. According to the module chosen, Edit Form below lists the forms in that module, and the form providing the calendar's data (edit form) is chosen here. 

User-Heading-Start and Finish: All fields under this heading are mapped to the edit form's fields. The fields you choose correspond to fields in the edit form, and the mapping must follow this. 

User : Represents the grouped field in the calendar. For example, in a project tracking customer visits the User field may be sales representatives; in a project managing meeting rooms it may be the meeting rooms. 

Heading / Start / Finish: These fields are shown on the calendar event as in the image below.  

Heading: Customer Sales Meeting, Product Update & Strategy (meeting rooms or topics) 

Start/ Finish: 09.00-11.00 ... 

 

Start-Stop Hour Field: 

To set which view (day, workday, week, month) the calendar opens in, write that view type in the start-stop hour property of the calendar in Studio. 

 

Time Interval (Min.):

Sets the time slots shown in the calendar in minutes. The example below shows 40-minute and 60-minute views. 

 

 

 

 

Form Width/Form Height/Height/Width/From Left/Top: 

All these fields are used to size and position the Calendar component. Adjust them as you prefer. 

User Query: 

The field where queries for the Calendar's grouping data are written. It has two modes: SQL Server is selected by default; the other option is Xpoda Addon. The example below uses SQL Server. 

 

Example: 

  

 

blobid0.pngAn important point in the SQL queries written here is that there must be three columns, as in the screenshot above. Their names must be UserID, UserFullName and UserColor. The UserColor column colours the data shown in the calendar according to its group. 

 

To assign UserColor in your calendar projects, add the Color Box form tool to the Edit form by drag and drop in Xpoda Studio. It is used to choose the colour shown in the calendar. The first image shows the tool in Studio and the second on the client screen. After Color Box is added to the Edit form, the user chooses the colour to show in the calendar and saves. The colour is applied to the record's appearance in the calendar. 

 

 

Data Query; The field where queries for the Calendar's detail data are written. As in the image below, when mapping the Edit Form, the alias names in the Data Query (right) must be the same as the field names in the form (left). (Second row of images) 

If the field names are exactly the same, aliases are not needed. (First row of images) 

If UserTableID is not given in the Data Query, the calendar cannot tell which data to take and appears empty. So UserTableID is mandatory. 

  

  

 

blobid0.png

Using EventColor: 

By adding a field named EventColor to the SQL query in Data Query, colouring can be done per record. When EventColor is added, it overrides the UserColor field in the User Query and the calendar uses its own colour. 

Using EventColor is optional; if it is not used, it need not be in the Data Query. 

 

 

  

 

 

 

The colours of registered users (UserColor) were set with the Color Box in the Calendar Users form. 

But when a Color Box is used on the Edit Form where calendar data is entered, the chosen colour is EventColor and the colour from the 'Edit Form' is applied to that person's event. 

Below, the default colour of User1 is grey. If no colour is chosen on the 'Edit Form', the calendar looks as below. 

 

 

 

When a colour is chosen in the Color Box on User1's 'Edit Form' and saved, the calendar looks as below: 

 

 

 

 

Let's look at the calendar tool on the client screen.  

The options at the top right of the calendar change the view as below. When the screen language is English, the calendar content is also in English. 

 

Day View: 

 

Month View: 

 

Week View: 

   

Agenda View: 


 

 

Work Week View: 

 

 

Hour View: 

 

In hour view, the calendar shows hourly plans for each day of the week. To see hourly details in a day, scroll the bar below horizontally to the related time slots. 

The 'Show All Day' button at the bottom left shows all time slots of the day. When not clicked, only 09:00 – 18:00 is shown by default. 

 

Show All Day not clicked: 

 

 

Show All Day clicked: 

 

Let's continue with how the calendar is used on the Client screen: 

A new event can be created by double-clicking an empty cell. For example, double-clicking the 09:00 cell opens an Edit Form with that time slot and user. The form opens filled (mapped) with the cell's date, time and user. 

 

After saving, the information entered in the Edit Form is reflected on the calendar and shown as an event in that time slot. 

 

Double-clicking an existing event opens the Edit Form with that event's information. The event can be updated or deleted there. 

 

Updating on the Calendar:  

Events can be moved to another date, day or hour by drag and drop. This updates them visually on the calendar and also in the database. 

For example, you want to move a meeting planned for Thursday 09:00 – 11:00 to Monday at the same time. Drag the event to the desired day and time. You can also widen or narrow the event to lengthen or shorten its time range. 

 

The Customer Sales Meeting planned for Thursday was dragged to Monday, and the event was also updated in the database. This updated the event's date and time not only on the calendar but in the database too. To check, double-click the cell to open the Edit Form and review the details. 

(Images 1, 2 and 3 show the steps.) 

 

 

The Customer Sales Meeting, originally 09:00-11:00, was to be extended to 3 hours by widening the event, with an end time of 12:00. Below, the event was widened and the time was reflected on the calendar. 

 

 

To delete an event (meeting), hover over it on the calendar and click the X icon at the top right. This removes the event from the calendar. 

 

CALENDAR EXAMPLE: 

Let's create a calendar example together. 

As a first step, design an Edit Form screen for the event values shown on the calendar. This form lets users enter the required information for each event. Configuring the Edit Form correctly is important for events to appear correctly. 

 

Open a new Responsive Form. 

 

 

When Responsive Form is chosen, a new form screen named Form_1 is created.   

Select the form named Form_1, then in the form's properties on the right, Name in the field CustomerMeeting write it to name the form (No:1). Since we will save to the database, choose the form type Form (No:3). For the table name, in TableName in the field XPD_MEETING write it (No:2). 

 

From the form tools on the left, drag 1 Text Box, 1 Drop Down Box, 1 Color Box, 2 DateTime and 1 Button onto the form. 

 

Select the Labels one by one and name them in the Text property as in the image. Press Enter after naming.

To set the form tools' properties, select each tool in turn and make the settings as in the image. Press Enter after naming in the Name field.  

So that the data entered on screen is saved to the table when Save is clicked on the Client screen, add an action to the Save button. Select the Save button, then the actions section, and click Add New Action.   

From the options;

Type of Action: choose When clicked. 

Operation: choose Save. 

Then save the action.

 

The saved action looks as in the image. To delete the action, click the bin icon on the right. To change it, click the pencil icon in the middle; to pause it, click the pause icon on the left.

metin, ekran görüntüsü, yazı tipi, sayı, numara içeren bir resim
<p>Yapay zeka tarafından oluşturulan içerik yanlış olabilir. 

 

After the settings, save the project and click Run to switch to the client screen.

 

daire, saat, simge, sembol, tasarım içeren bir resim</p>
<p>Yapay zeka tarafından oluşturulan içerik yanlış olabilir.

blobid0.png

The client screen shows the last saved state of the project. If you switch without saving, the latest changes are not shown.

blobid0.png

After the project is saved, since the screen's Type is 'Form', a new table named as in Table Name is created in the XPODA database with the field names and data types added to the screen.

 

To manage the calendar users shown in the Personnel drop-down, let's create a User Definition Screen. It is named Calendar Users and defines and manages the users that can be assigned to calendar events.

 

Open a new Responsive Form. Click the New Form icon marked with a red frame in the image below.

Choose Responsive Form in the window that opens.

When Responsive Form is chosen, a new form screen named Form_2 is created.  

Select the form named Form_2, then set the form properties on the right as below.

From the form tools on the left, drag 1 Text Box, 1 Color Box, 1 List and 1 Button onto the form.


Select the Labels one by one and name them in the Text property as in the image. Press Enter after naming.

To set the form tools' properties, select each tool in turn and make the settings as in the image. Press Enter after naming in the Name field.   

SELECT UserTableID AS ID, Users, UserColor FROM Calendar_Users WITH (NOLOCK)

 

 

So that the data entered on screen is saved to the table when Save is clicked on the Client screen, add an action to the Save button. Select the Save button, then the actions section, and click Add New Action.   

From the options;

Type of Action: choose When clicked. 

Operation: choose Save. 

Then save the action.

The saved action looks as in the image. To delete the action, click the bin icon on the right. To change it, click the pencil icon in the middle; to pause it, click the pause icon on the left.

So that previously saved data is shown in the List when the Client screen opens, add an action. This action triggers the list automatically.

The data returned by the list's query is shown in the list.

 

To add the action that triggers the List when the screen opens, double-click the form named Calendar Users, then select the actions section and click Add New Action.   

From the options;

Type of Action: choose When the form is opened. 

Operation: choose Update Value. 

Value Area:  choose GridListe_1.  

Then save the action.

The saved action looks as in the image. To delete the action, click the bin icon on the right. To change it, click the pencil icon in the middle; to pause it, click the pause icon on the left.

 

When Save is clicked on the Client screen, the data entered is saved to the table named in Table Name. So that the table data is shown in the list after saving, add an action to the Save button that triggers the list. Select the Save button, then the actions section, and click Add New Action.   

From the options;

Type of Action: choose When clicked (No:1). 

Operation: choose Update Value (No:2)  

Value: GridListe_1 (No:3)

Then save the action (No:4).

After the settings, save the project and click Run to switch to the client screen. Add the users User1, User2 and User3, choose their colours and save.

 

blobid0.png

daire, saat, simge, sembol, tasarım içeren bir resim</p>
<p>Yapay zeka tarafından oluşturulan içerik yanlış olabilir.After the project is saved, since the screen's Type is 'Form', a new table named as in Table Name is created in the XPODA database with the field names and data types added to the screen.

 

 

Enter the user names in the Users field and, after choosing each user's colour, save with the Save button. 

 

After these steps, we can continue with the Edit Form (CustomerMeeting). To get the users shown in the Personnel field from the Calendar_Users table, write the query below in the drop-down.

 

Personnel Drop-Down Query:

 

SELECT UserTableID AS ID, Users FROM Calendar_Users WITH (NOLOCK)

Client view:

Create a new Responsive Form. Click the new Form icon marked with a red frame in the image below. 

Choose Responsive Form in the window that opens.

When Responsive Form is chosen, a new form screen named Form_3 is created.  

Select the form named Form_3, then set the form properties on the right as below.

Select the Properties area marked 1. Then choose Report in the Type field marked 2. 

When a form's Type is 'Form', a new table named as in Table Name is created in the XPODA database in SQL. If no table should be created, set the form's Type to 'Report'. The name written in Display Name is the name shown for the form on the client screen; Turkish characters can be used. (Image 2 No:3)

 

The form we created opened with the Responsive Form and Report properties.

 

Drag the Calendar tool from the area marked 1 onto the form. After this, the Calendar is added to the form as shown in 2.

 

To add the information to show on the Calendar on the Client screen, first select the Calendar. Then write the query in the SQL Query property on the right. An example SQL query is below:

SELECT UserTableID AS UserID , Users AS UserFullName, UserColor AS UserColor FROM Calendar_Users WITH (NOLOCK)

 

To check that the queries in SQL Query run without errors, follow these steps:

Clicking the query wizard area marked 1 opens the Query Builder screen.

Clicking the button with the ' ! ' symbol marked 2 opens the Query Result screen with the result of the query.

If a result appears in the Query Result screen marked 3, the query runs without errors.

Make the related mappings in the other properties of the Calendar and write the required query in Data Query. 

 So that calendar data is transferred correctly, make the mapping in the fields marked 3 below.

 

blobid0.png

In the Data Query, the alias names must be exactly the same as the fields of the mapped form.

Data Query:

 

SELECT UserTableID , Personnel AS Personnel , Topic AS Topic, StartDate AS StartDate, EndDate AS EndDate , Color AS EventColor FROM XPD_MEETING WITH (NOLOCK)

 

Save the project and click Run to switch to the client screen.

Our calendar is ready to show events. Now enter the meeting (event) information to show on the calendar through the edit form. We can go to the edit form directly, or double-click the cell for the desired user and time on the calendar.

 

On the Client screen, to create a new record in the Edit Form, click the down arrow next to Personnel and choose the first option, then enter Topic, StartDate and EndDate. Choose a colour in Color Box if you like. If no colour is chosen, the user's colour set in Calendar Users is shown on the calendar. If a colour is chosen in the edit form, EventColor overrides UserColor and the event is shown in the chosen colour (pink). Then click Save to create the record. The saved event (meeting) can now be seen on the Calendar. 

 

Go to the screen with the calendar and check.

 

Template Example in the Calendar:

There are two important points when creating a template in the calendar:

1. Mapping with Edit Form fields: 
There is a system-defined format for four fields, and these fields must be used in that format. The formats are below.

 

$Pdata.UserID$

$Pdata.title$

$Pxpoda.toString(data.start, "hh:mm")$

$Pxpoda.toString(data.end, "hh:mm")$

 

blobid0.png, ResimFor it to work correctly, the first letter of the title field must be lower case.

The usage above became standard with version 4.1.3, and "data." usage was removed.

From version 4.1.3, parameters must be used in the format below:

$PUserID$
$Ptitle$

For date fields, add the date data to the Calendar's Data Query. 
In the template, use the ALIAS of the date column defined in the query.

For example; $PDateColumn$
 

 

blobid0.png

If a name or other data rather than an ID should come in the User field, it can be used like the extra fields from the data query. This is explained in item 2 below.

 

2. Extra fields from the Data Query: 
If the Data Query returns other fields besides these four, use them with the aliases you gave in the query, in this format:

 
$Pdata.Alias$ 
Here Alias, must exactly match the alias in your Data Query. An example is below.

 

SELECT X.UserTableID , Personnel AS Personnel , Users AS Users, Topic AS Topic, StartDate AS StartDate, EndDate AS EndDate , Color AS EventColor, UserImage FROM XPD_MEETING X WITH (NOLOCK) LEFT JOIN Calendar_Users C ON X.Personnel=C.UserTableID

 

The Calendar with a Template on the Client Screen: