You need to sign in to do that
Don't have an account?
Maksim Kholodny
Validation rule for an Order with the status "Completed"
hello, community! I'm a newbie and I really need some help.
the Order object has values in the status field: "New", "Activated", "In Progress", "Received", "Finished", "Canceled".
The Order object has a field: Account Name, Order Owner, Order Start Date, Status, Opportunity, Ship To Contact, Order End Date, SLA Offers Date.
You cannot change a closed Order with the Finished status
I've tried using this formula, but it doesn't work:
AND(
ISPICKVAL(Status, "Finished"),
OR(
IS CHANGED(Status),
ISCHANGED( Account Id ),
ISCHANGED( OwnerId ),
ISCHANGED( Effective Date ),
ISCHANGED( OpportunityId ),
ISCHANGED( Ship To Contact Id ),
ISCHANGED( EndDate ),
ISCHANGED( SLA_Offers_Date__c )
)
)
the Order object has values in the status field: "New", "Activated", "In Progress", "Received", "Finished", "Canceled".
The Order object has a field: Account Name, Order Owner, Order Start Date, Status, Opportunity, Ship To Contact, Order End Date, SLA Offers Date.
You cannot change a closed Order with the Finished status
I've tried using this formula, but it doesn't work:
AND(
ISPICKVAL(Status, "Finished"),
OR(
IS CHANGED(Status),
ISCHANGED( Account Id ),
ISCHANGED( OwnerId ),
ISCHANGED( Effective Date ),
ISCHANGED( OpportunityId ),
ISCHANGED( Ship To Contact Id ),
ISCHANGED( EndDate ),
ISCHANGED( SLA_Offers_Date__c )
)
)
In validation rules you have to use the API name of the field.
In your case, try to remove spaces:
AND(
ISPICKVAL(Status, "Finished"),
OR(
IS CHANGED(Status),
ISCHANGED( AccountId ),
ISCHANGED( OwnerId ),
ISCHANGED( EffectiveDate ),
ISCHANGED( OpportunityId ),
ISCHANGED( ShipToContactId ),
ISCHANGED( EndDate ),
ISCHANGED( SLA_Offers_Date__c )
)
)
Examples of validation rules (https://help.salesforce.com/s/articleView?id=sf.fields_useful_field_validation_formulas.htm&type=5)
That's how it works:
AND( ISPICKVAL( PRIORVALUE( Status ) , "Finished"),
OR(
ISCHANGED(Status),
ISCHANGED( AccountId ),
ISCHANGED( OwnerId ),
ISCHANGED( EffectiveDate ),
ISCHANGED( OpportunityId ),
ISCHANGED( ShipToContactId ),
ISCHANGED( EndDate ),
ISCHANGED( SLA_Offers_Date__c )
)
)