Jump to content

Opening hours: Difference between revisions

From Resco's Wiki
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 5: Line 5:
Once you're done editing opening hours, click '''Save'''.
Once you're done editing opening hours, click '''Save'''.


[[File:Configure opening hours.png|600px]]
[[File:Configure opening hours.png|alt=Opening hours: Configure opening hours overview|600px]]


== Custom field for opening hours ==
== Custom field for opening hours ==
Line 13: Line 13:
To add fields to an entity, you need to change the data model. For example, for Resco Cloud, use the [[Admin Console]]. Select '''[[Admin_Console#Entities|Data > Entities]]''', go to the entity that needs custom opening hours (for example, account), and add a new field.
To add fields to an entity, you need to change the data model. For example, for Resco Cloud, use the [[Admin Console]]. Select '''[[Admin_Console#Entities|Data > Entities]]''', go to the entity that needs custom opening hours (for example, account), and add a new field.


[[File:Custom field for opening hours.png|600px]]
[[File:Custom field for opening hours.png|alt=Opening hours: Custom field for opening hours|600px]]


Once the field is created on the backend, go to Woodford and [[App_projects#Managing_fields|enable the field in your app project]].
Once the field is created on the backend, go to Woodford and [[Data_model_in_mobile_apps#Managing_fields|enable the field in your app project]].


== Opening hours in the app ==
== Opening hours in the app ==
Line 21: Line 21:
Users of the mobile app can then modify the opening hours of a particular record.
Users of the mobile app can then modify the opening hours of a particular record.


[[File:Edit record opening hours.png|600px]]
[[File:Edit record opening hours.png|alt=Opening hours: Opening hours in the app: Edit record opening hours|600px]]


== Technical information ==
== Technical information ==


If you need to read or modify the opening hours in an external system, information about the exact syntax of the custom text field can help you get started. Opening hours are stored in JSON format in the following structure:
If you need to read or modify the opening hours in an external system, information about the exact syntax of the custom text field can help you get started. Opening hours are stored in JSON format in the following structure.
 
{{Note|If you want to define one period of opening hours per day, use morningOpen and afternoonClose as shown in the Tuesday example.|Tip}}


<syntaxhighlight lang="json">
<syntaxhighlight lang="json">

Latest revision as of 06:58, 16 May 2024

For many entities, for example, accounts or contacts, you can configure opening hours. This can be useful when planning appointments using the route plan so that you don't plan to visit someone when they are not available. Edit an app project and select Opening Hours from the Project menu.

For each entity, you can configure multiple intervals of opening hours each day. The setting configured on the entity level in Woodford is the default value, used if the record does not have custom opening hours configured. To enable custom opening hours, select the field on the entity that contains the opening hours information.

Once you're done editing opening hours, click Save.

Opening hours: Configure opening hours overview

Custom field for opening hours

In order to configure opening hours per-record, you need to add a custom field to your entity. This field must be of the type single line of text and the recommended minimum length is 1000 characters.

To add fields to an entity, you need to change the data model. For example, for Resco Cloud, use the Admin Console. Select Data > Entities, go to the entity that needs custom opening hours (for example, account), and add a new field.

Opening hours: Custom field for opening hours

Once the field is created on the backend, go to Woodford and enable the field in your app project.

Opening hours in the app

Users of the mobile app can then modify the opening hours of a particular record.

Opening hours: Opening hours in the app: Edit record opening hours

Technical information

If you need to read or modify the opening hours in an external system, information about the exact syntax of the custom text field can help you get started. Opening hours are stored in JSON format in the following structure.

Tip If you want to define one period of opening hours per day, use morningOpen and afternoonClose as shown in the Tuesday example.
{
    "periods": [
        {
            "periodId": 1,
            "periodLabel": "Monday",
            "morningOpen": "09:00",
            "morningClose": "12:00",
            "afternoonOpen": "12:30",
            "afternoonClose": "17:00"
        },
        {
            "periodId": 2,
            "periodLabel": "Tuesday",
            "morningOpen": "09:00",
            "afternoonClose": "17:00"
        },
        {
            "periodId": 3,
            "periodLabel": "Wednesday",
            "morningOpen": "09:00",
            "morningClose": "12:00",
            "afternoonOpen": "12:30",
            "afternoonClose": "18:00"
        },
        {
            "periodId": 4,
            "periodLabel": "Thursday",
            "morningOpen": "09:00",
            "morningClose": "12:00",
            "afternoonOpen": "12:30",
            "afternoonClose": "17:00"
        },
        {
            "periodId": 5,
            "periodLabel": "Friday",
            "morningOpen": "09:00",
            "morningClose": "12:00",
            "afternoonOpen": "12:30",
            "afternoonClose": "17:00"
        },
        {
            "periodId": 6,
            "periodLabel": "Saturday",
            "morningOpen": "10:00",
            "morningClose": null,
            "afternoonOpen": null,
            "afternoonClose": "12:00"
        },
        {
            "periodId": 0,
            "periodLabel": "Sunday",
            "morningOpen": "10:00",
            "morningClose": null,
            "afternoonOpen": null,
            "afternoonClose": "12:00"
        }
    ]
}