1

I have the following formula inside the list validation:

=IF(Status="Invoiced",IF([Customer Invoiced Date]<>"",TRUE,FALSE),TRUE)=IF(Status="Commission Paid",IF([Commission Paid Date]<>"",TRUE,FALSE),TRUE)=IF(Status="Delivered",IF([Order Delivered Date]<>"",TRUE,FALSE),TRUE)

and I have 3 content types for the list:

  1. Project
  2. Sales
  3. Task

Where I want to apply the formula only if content type != Task? Can anyone advice?

4
  • Are the fields used in validation formula added to all content types? May 10, 2021 at 5:29
  • Are you using modern experience for list forms or classic experience?? May 10, 2021 at 5:53
  • @GaneshSanap i am using classic
    – john Gu
    May 10, 2021 at 8:17
  • If you are using classic experience then it can be easily achieved using client side scripting (javascript) by overriding PreSaveAction() function - check 1st link in my answer below. May 10, 2021 at 8:41

1 Answer 1

2
+200

You cannot use the "Content Type" in list validation formulas.

So, there is no way to add the conditional formula based on the current content type selected on list form.

If you are using classic experience, you can override the PreSaveAction() function on list forms to validate the entered data before saving the data.

For more information on using PreSaveAction(), check this: Is there a way to add the Content Type title inside our custom list validation settings' Formual

Similar questions:

  1. List Item Validation With The Content Type Field
  2. Use "Content Type" in list or column validation

Update from comments:

If you want to disable the validation when ItemNumber column contains -Task-, use below formula:

=IF(ISERROR(FIND("-Task-", [ItemNumber])), <Your-Original-Formula>, TRUE)

The later validation in above formula will trigger when ItemNumber column does not contain -Task-.

4
  • ok fine .. in this case i have field called ItemNumber.. and if the Item number does not contain "-Task-" i want to disable the validation is this possible?
    – john Gu
    May 10, 2021 at 8:19
  • Check updated answer. you can disable the validation if Item number does not contain "-Task-". May 10, 2021 at 9:22
  • actually if the itemnumber contain -Task- to disable the validation..
    – john Gu
    May 10, 2021 at 9:47
  • That's what I thought earlier so highlighted the text in above comment :D . Check updated formula, it should work for you now. May 10, 2021 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.