---
title: "Example 14 - Closure Screen - Ensure all Activities named \"Form 211\" are closed"
canonical: "https://help.fieldbuddy.com/space/FBDOCS/5987926034/Example+14+-+Closure+Screen+-+Ensure+all+Activities+named+%22Form+211%22+are+closed"
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 a Work Order if it contains an activity with a name that includes 'Form 221' and is still open.

```
{
    "Id": "EXAMPLE-14",
    "Name": "Disable WO Closure without non-completed FORM 221",
    "Code__c": "null",
    "Error_Message__c": "FORM 221 is required to be closed on this Work Order",
    "Formula__c": "",
    "SwiftFormula": {
        "params": [
            {
                "var": "${CURRENT_WORK_ORDER_ID}",
                "constant": "${Constants.CURRENT_WORK_ORDER_ID}"
            }
        ],
        "helpers": [
            {
                "context": "GLOBAL",
                "method": "_.findIndex",
                "from": "FIELDBUDDY__Work_Order_Line_Item__c",
                "where": {
                    "fields": [
                        "FIELDBUDDY__Status__c",
                        "FIELDBUDDY__Type__c",
                        "Name",
                        "FIELDBUDDY__Work_Order__c"
                    ],
                    "values": [
                        [
                            "Open",
                            ""
                        ],
                        "Activity",
                        "%Form 221",
                        "${CURRENT_WORK_ORDER_ID}"
                    ]
                },
                "var": "${FORM_221_OPEN_INDEX}"
            }
        ],
        "formula": "f=()=>{return ${FORM_221_OPEN_INDEX} >= 0 };Boolean(f());"
    },
    "Mobile_Page__r": "Work Order Closure"
}
```




![Example-14-Closure Screen.png](media://51f0d242-303c-49f4-8e39-c70b5395ac48)



```
EXAMPLE-14 Disable WO Closure without non-completed FORM 221 at Work Order Closure
f=()=>{return 33 >= 0 };Boolean(f());
Pass: false
ErrorMessage: FORM 221 is required to be closed on this Work Order
```