Skip to content

Configuration

In this part you'll learn how you can configure Work order to better suit your customer's needs. If the installation is done properly, you should already have a working standard solution up and running, but please read this section to better understand how you can tweak Work order if and when that is needed.

Work order address

In order for Maps to work properly, each work order has an address (consisting of workorder.address, workorder.zipcode and workorder.city).

Since the logic for populating these field will be different for each solution, you'll need to write the code for this and put in the work order's custom lime object.

To show a clickable link on the work order objectcard you need to add the component lwc-limepkg-workorder-descriptive-link. If you do this, you also need to configure the hierarchy config.

hierarchy config:

If you have a hierarchy structure of limeobjects you can configure this in Lime Admin so that you can get a clickable link to the closest parent object. Here's an example of an hierarchy from the Real Estate industry:

  1. Object
  2. Stair
  3. Building
  4. Property
  5. Area

Work Order Behaviors

To help build up the business logic around work orders this package comes with several small optional pieces of code. They are called behaviors and can be enabled/disabled at runtime to enhance the solution's custom limeobject in a simple way.

For them to work the work order lime type must first be decorated with @workorder, which you should have in place from the installation:

from lime_type.limeobjects import LimeObject
from limepkg_workorder.decorators import workorder

@workorder()
class Workorder(LimeObject):
    pass

def register_limeobject_classes(register_class):
        register_class('workorder', Workorder)

Once in place, the execution of the custom limeobject will be altered:

before_update

  1. sets urgent from priority
  2. sets deadline from priority
  3. creates protocols for scheduled work orders
  4. runs the solution's original before_update method
  5. sets sortingfield

Set Sortingfield

In Lime CRM it is convenient to have a single sorting value to sort work orders by. This sorting value must consider multiple aspects of the work order and how important they are to the field worker.

By enabling the Set sortingfield setting the sorting field property is set automatically based on the finished, urgent, booking start and deadline properties of the work order.

The following settings must be configured in Lime Admin:

  • Work order Limetype
  • Work order property Sorting field
  • Work order property Booking start
  • Work order property Deadline
  • Work order property Urgent
  • Work order property Finished may optionally be configured

If you would like to have a different sorting, you can use a different field for sorting in Lime Admin. If you want a certain logic, you need to apply that logic to that field.

Set Urgent From Priority

Each work order has a yes/no field indicating whether a work order should be considered urgent. This affects for example visual indicators such as highlighting or could be used for a backend logic like sending a SMS to the field worker that is assigned (not included in standard setup).

By enabling Set urgent from priority setting in Lime Admin, the urgent field is set automatically when the priority is set to urgent.

The following settings must be configured in Lime Admin:

  • Work order Limetype
  • Work order property Priority
  • Work order property Urgent
  • The Urgent priority key that is used to tell if a work order's priority is urgent

Set Deadline From Priority

When it is important that a work order is finished within a specific time frame the deadline property should be used. This property could affect wether a work order is late, needs to be done today, etc.

By enabling the Deadline from priority setting the the deadline property is set automatically based on the priority of the work order. Read more about this in the How it works section.

The following settings must be configured in Lime Admin:

  • Work order Limetype
  • Work order property Deadline
  • Work order property Priority
  • The Priority -> deadline config that describes how the different Priority keys should set the deadline

Create Protocols for Scheduled Work Orders

Re-ocurring work orders like monthly inspections, yearly service, etc. should typically have a predefined set of protocols on them.

By enabling the Create protocols for scheduled work orders setting work orders created from schedules will automatically get the correct protocols attached when they are created. The protocols are defined on the schedule's' protocol_keys field as a |-separated string. In order not to have to type in each protocol key, we use a web component on this field to make it behave as a multiple choice picker.

Requires new object card available in Lime CRM 2021.1.523 (2.154.0) and later

The following settings must be configured in Lime Admin:

  • Work order limetype
  • Work order property Created from (relation to scheduled work order)
  • Scheduled work order limetype
  • Scheduled work order property Protocol Keys
  • The Schedule / Recurring / Scheduled work order object card must have the lwc-limepkg-form-protocol-selector web component configured for the protocol_keys field.

Report time and material

The report time and material tool is very flexible, so please spend some time configuring it to your customer's needs. The three main parts you need to configure are:

  • Tabs
  • Fields
  • Recent

Tabs

You can theoretically have as many tabs as you like. A standard configuration might have separate tabs for Time, Material and Other. Each tab will have it's unique set of fields and it's own definition of what makes something show up in recent (=what makes an article row unique)

Fields

The set of fields will most likely be different for each tab. For instance, it might make sense to have the field "category" in the Material tab but not in the Time tab. "Article" will most likely be present on all tabs. "Quantity" needs to be present, however.

Recently used articles

By setting up "Group by in recently used", the user gets a list of recent article rows at the bottom of the tool. These can be used for quickly filling out more than one field. Great when you report the same thing time and time again. For instance, I might have the fields "Article", "Description", "Date", "Cost", "Price" and "Quantity" for my Time tab. By setting "Group by in recently used" = true for "Description", article rows with different descriptions will be available among recent.

Lime admin config Group by Logging material with grouping

Article quantity incrementation

By specifying Property for quantity increment on article, you can change the behavior when a user clicks the +/--buttons. For instance, an article "Normal time" can be logged in 0,5 hour increments whereas an article "Toilet seat" can only be logged in full (1) increments.

Article Row Behaviors

To help build up the business logic around article rows this package comes with several small optional pieces of code. They are called behaviors and can be enabled/disabled at runtime to enhance the solution's custom limeobject in a simple way.

For them to work the article row lime type must first be decorated with @articlerow, which you should have in place from the installation:

from lime_type.limeobjects import LimeObject
from limepkg_workorder.decorators import articlerow

@articlerow()
class ArticleRow(LimeObject):
    pass

def register_limeobject_classes(register_class):
    register_class('articlerow', ArticleRow)

Once in place, the execution of the custom limeobject will be altered:

before_update

  1. copies values from the article
  2. runs the solution's original before_update method
  3. calculates total cost and price
  4. sets certifiers when approves

Calculate Total Price and Cost

Its very common to report multiple copies of an article in the same article row. This is expressed by having quantity, price and totalprice properties.

By enabling the Calculate total price and cost the totalcost and totalprice properties will automatically be updated.

The following settings must be configured in Lime Admin:

  • Article row Limetype
  • Article row property quantity
  • Article row properties price and totalprice

    And/or article row properties cost and totalcost

Copy values from article to article rows

It is best practice to always copy the most important attributes from the article when creating an article row. Later on the article's price might change and then we want the article row's price to be retained. Another scenario is when the article is deleted from the system altogether.

By enabling Copy values from article to article rows a configurable set of properties are copied when the article row is created or whenever the article row is changed to another article.

The following settings must be configured in Lime Admin:

  • Article Limetype
  • Article row Limetype
  • Article to Article Row Mapping

Approved can only be edited by certifiers

It's common that you want to restrict users from modifying article rows that are approved or invoiced.

By enabling the Approved can only be edited by certifiers setting in Lime admin, the object access group on the article row will be replaced with the Certifiers group when you change articlerow status to anything else than notapproved.

The following settings must be configured in Lime Admin:

  • Article row Limetype
  • Article row property Articlerow Status

In addition, the following is also required:

  • The default article row status key must be set to notapproved
  • The group Certifiers exists
  • The object access for article row should be configured like this:
Read Update Delete
Owner x
Group x x x
Other x

Resource planner

The resource planner provides a user interface where work orders can be assigned to resources by dragging them from a list with unassigned work to a timeline view where each resource has their own row.

By dragging a work order to a time slot on the timeline will set three lime properties on the work order limeobject:

  • The resource relation representing the resource on the row in the timeline
  • The start date
  • The end date

The timeline view can also be configured to show when resources are absent by leveraging another lime type that simply is called absence. These events are read-only in the timeline while work order objects can be moved around.

By moving a work order on the timeline left and right will change the start and end datetime properties. When the work order is moved up and down, the resource relation property will change to the resource represented by that row in the timeline view.

Configuration of lime types used

To let the Resource planner know what lime type and properties to use for each thing, Lime Admin is used to configure everything.

From here on when referring to the types used in the Resource planner, the documentation will assume the following mapping:

  • Work order: The workorder lime type
  • Resource: The coworker lime type
  • Absence: The absence lime type

Required options for work order:

  • Lime type used for work orders
  • Property for booking start
  • Property for booking end
  • Property for primary text in the resource planner
  • Property for secondary text in the resource planner
  • Relation to Resource
  • Property on resource used as primary text in the resource planner
  • Default filter for resources in the resource planner

Tasks

  1. Go to Lime Admin -> Add-ons -> Workorder
  2. Configure the options for Work order
  3. To enable use of absence, scroll down and configure all Absence options

Customization

When using more than one filter for unassigned work orders, it can be useful to configure more than one button that opens the Resource planner. This is done similarly to how info tiles are configured, but all options are entered in the Start Page designer.

To customize the icon, please use the icon picker in Lime Elements to copy the correct name.

The following options exist for the button:

  • icon (defaults to overtime)
  • color (defaults to var(--lime-blue))
  • filter (defaults to the filter id chosen in Lime Admin - Add-ons - Workorder)

The text on the button will always be the localized name of the filter.

Note

The widget will show up empty if you specify a filter that is not configured to be available in the Resource planner, even though you have specified an existing filter id.

Example Start Page configuration

Let's imagine there are filters for unassigned work orders and urgent unassigned work orders and the customer want to access both from the Start Page. To enable this, we place two buttons on the Start Page that will launch the Resource Planner. The filter used for the button clicked will be preselected when the Resource Planner opens.

The following Start Page configuration has a setup of the two filters. To make the urgent unassigned work orders pop out, it has been configured to use a red color and a slightly different icon. The two widgets to the right are ordinary info tiles.

Start Page

For reference, a complete Start Page configuration with all the options combined:

{
    "components": [
        {
            "props": {
                "config": {
                    "icon": "tear_off_calendar",
                    "color": "var(--lime-blue)",
                    "filter": "webclient.workorder.unassigned"
                }
            },
            "name": "lwc-limepkg-workorder-unassigned-workorders",
            "size": "rectangle-small"
        },
        {
            "props": {
                "config": {
                    "icon": "exclamation_mark",
                    "color": "var(--lime-red)",
                    "filter": "webclient.workorder.unassignedandurgent"
                }
            },
            "name": "lwc-limepkg-workorder-unassigned-workorders",
            "size": "rectangle-small"
        }
    ],
    "name": "Back office",
    "id": "bo"
}

Form protocol

Each work order has a tab called "Protocol". If your customer doesn't need protocols, it's suggested you remove this tab. You do that in the general view config of the work order lime type.

Remove form protocol custom tab

Form protocol has its own documentation site where you can read up on how to configure it.

Recurring work orders

Recurring work orders is a configuration of Scheduled lime objects, a tool for creating a type of lime object according to a schedule. Scheduled lime objects has its own documentation site where you can read up on how to configure it.

Attach protocols to each work order

Please make sure you are rendering the field scheduledworkorder.protocol_keys using the web component lwc-limepkg-form-protocol-selector Protocol web component Lime Admin config Protocol web component on card