---
title: "Example 12 - Before Delete - Prevent deletion of WOLI with certain name"
canonical: "https://help.fieldbuddy.com/space/FBDOCS/5987631128/Example+12+-+Before+Delete+-+Prevent+deletion+of+WOLI+with+certain+name"
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 deleting a Line Item if its name contains 'Form 211'.

```
{
    "Id": "EXAMPLE-12",
    "Name": "Disable Form 211 Deletion",
    "Code__c": "BEFOREDELETE",
    "Error_Message__c": "You're not allowed to delete Form 211",
    "SwiftFormula": {
        "params": [
            {
                "var": "${NAME}",
                "field": "Name",
                "table": "FIELDBUDDY__Work_Order_Line_Item__c"
            }
        ],
        "helpers": [],
        "formula": "f=()=>{return String('${NAME}').includes('Form 211');};Boolean(f());"
    },
    "Mobile_Page__r": "Work_Order_Line_Item__c"
}
```


![Example-12-Before Delete.png](media://a9745270-2a1c-45d6-b9ed-c9734b7741d3)


```
EXAMPLE-12 Disable Form 211 Deletion at Work_Order_Line_Item__c
f=()=>{return String('A-Form 211 Installatie').includes('Form 211');};Boolean(f());
Pass: false
ErrorMessage: You're not allowed to delete Form 211
```