---
title: "Example 13 - Closure Screen - Make sure time registration with specific type is present for current WO"
canonical: "https://help.fieldbuddy.com/space/FBDOCS/5987762222/Example+13+-+Closure+Screen+-+Make+sure+time+registration+with+specific+type+is+present+for+current+WO"
format: markdown
---
For Details check: [https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/5381455880](https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/5381455880)

This example might not have an immediate practical use, but it can serve as a starting point for creating one.

It shows how to prevent closing Work Orders with a Closure Status of 'Solved' if the Work Order has no Service Visit Timesheet Line items.

```
{
    "Id": "EXAMPLE-13",
    "Name": "Work Order can't be closed as SOLVED if there's no Service Time registered",
    "Code__c": null,
    "Error_Message__c": "Work Order can't be closed as SOLVED if there's no Service Time registered.",
    "Formula__c": "",
    "SwiftFormula": {
        "params": [
            {
                "var": "${ID}",
                "table": "FIELDBUDDY__Work_Order__c",
                "field": "Id"
            },
            {
                "var": "${CLOSURE_STATUS}",
                "table": "FIELDBUDDY__Work_Order__c",
                "field": "FIELDBUDDY__Closure_Status__c"
            }
        ],
        "helpers": [
            {
                "method": "_.count",
                "select": "Id",
                "from": "FIELDBUDDY__Timesheet_Lineitem__c",
                "where": {
                    "fields": [
                        "FIELDBUDDY__Type__c",
                        "FIELDBUDDY__Work_Order__c"
                    ],
                    "values": [
                        "Servicebezoek",
                        "${ID}"
                    ]
                },
                "var": "${SERVICEBEZOEK_COUNT}"
            }
        ],
        "formula": "f=()=>{return (${SERVICEBEZOEK_COUNT} === 0) && ('${CLOSURE_STATUS}' === 'SOLVED'); };Boolean(f());"
    },
    "Mobile_Page__r": "Work Order Closure"
}
```


![Example-13-Closure Screen.png](media://dc27733e-c36f-4e51-acbb-22d46e03ac8c)



```
EXAMPLE-12 Work Order can't be closed as SOLVED if there's no Service Time registered at Work Order Closure
f=()=>{return (0 === 0) && ('SOLVED' === 'SOLVED'); };Boolean(f());
Pass: false
ErrorMessage: Work Order can't be closed as SOLVED if there's no Service Time registered.
```