I have a validation Rule that I require assistance with , this validation rule should only allow fields to be updated by the two profile ids specified:

```
NOT(
    OR(
        $Profile.Id = "00e58000000yYlm",
        $Profile.Id = "00e58000000E6lK",
        AND(
            ISPICKVAL((WorkOrder.Status ), 'WithTechnician'),
            OR(
                ISCHANGED ( ProposedWorkPerformed__c),
                ISCHANGED ( ProposedOriginOfError__c ),
                ISCHANGED ( ProposedErrorComment__c ),
                ISCHANGED ( EstimatedDurationInMinutes__c ),
                ISCHANGED ( ActualWorkPerformed__c ),
                ISCHANGED ( ActualDurationInMinutes__c ),
                ISCHANGED ( ActualOriginOfError__c ),
                ISCHANGED ( ActualErrorComment__c ),
                ISCHANGED ( Status ),
                ISCHANGED ( Type__c ),
                ISCHANGED ( Source__c)
            )
        )
    )
)

```
['https://salesforce.stackexchange.com/questions/340403', 'https://salesforce.stackexchange.com', 'https://salesforce.stackexchange.com/users/94096/']
The big thing to keep in mind with validation rules is that their purpose isn't really to tell you what data is valid, but rather to tell you what data is *invalid*. It's a small shift in how you mentally frame the problem, but one that I find very helpful.

Instead of stating the outcome as "these profiles should be allowed to edit these fields", try working from "everyone who doesn't have one of these two profiles should be prevented from editing these fields".

Re-stating that a bit closer to a Validation Rule, "If the profile isn't one of our targets, and workorder status is `<X>`, and at least one of these fields are changing, then prevent the change"

**Note that** these comments are for clarity, and not in the appropriate format for a validation rule.

```
// segment 1
// User is not one of our target profiles
// The NOT() here should be limited to just the profile check
NOT(
    OR(
        Profile = profile1,
        Profile = profile2
    )
)

```

```
// segment 2
// workorder status check
ISPICKVAL((WorkOrder.Status ), 'WithTechnician')

```

```
// segment 3
// field change check
// a change to any of these fields should make this segment evaluate to "true", so OR()
//   is appropriate
OR(
    ISCHANGED(ProposedWorkPerformed__c),
    ISCHANGED(ProposedOriginOfError__c),
    ISCHANGED(ProposedErrorComment__c),
    ISCHANGED(EstimatedDurationInMinutes__c),
    ISCHANGED(ActualWorkPerformed__c),
    ISCHANGED(ActualDurationInMinutes__c),
    ISCHANGED(ActualOriginOfError__c),
    ISCHANGED(ActualErrorComment__c),
    ISCHANGED(Status),
    ISCHANGED( Type__c),
    ISCHANGED(Source__c)
)

```

The "plain language" description of what you're aiming to do tells you how these segments should be tied together (they should be `AND`-ed).

`<segment1> && <segment2> && <segment3>` would work, but the more typical approach is to use `AND()`.

```
AND(
    <segment1>,
    <segment2>,
    <segment3>
)

```
The issue is with OR operator on profile, AND operator on the status field, and NOT function. You haven't used/close them at appropriate places.

Below is the updated snippet.

```
AND(
ISPICKVAL(Status, "WithTechnician"),
NOT(OR(
$Profile.Id = "00e58000000yYlm",
$Profile.Id = "00e58000000E6lK")),
OR(
ISCHANGED(ProposedWorkPerformed__c),
ISCHANGED(ProposedOriginOfError__c),
ISCHANGED(ProposedErrorComment__c),
ISCHANGED(EstimatedDurationInMinutes__c),
ISCHANGED(ActualWorkPerformed__c),
ISCHANGED(ActualDurationInMinutes__c),
ISCHANGED(ActualOriginOfError__c),
ISCHANGED(ActualErrorComment__c),
ISCHANGED(Status),
ISCHANGED(Type__c),
ISCHANGED(Source__c)))

```

Take a look at sample validation rule examples [here](https://help.salesforce.com/articleView?id=fields_useful_field_validation_formulas.htm&type=0).

Thanks