0

I'm creating a transactions list for a SharePoint site.

I have two Content Types used for this list. Sale and Production.

The list items will mostly come from external sources, but in case of manual inputs I need to be sure that only negative numbers are used for sales.

This means that for Content Type Sale the column Quantity has a maximum value of -1.

For Content Type Production the column Quantity has a minimum value of 1.

How can I enforce different rules based on Content Type?

The closest I've found to the same issue is this:
Multiple content types in a list different, shared column but different default value

But I don't know what's meant with "at library level" in the solution.

1 Answer 1

0

It means that you have to define separate site columns Quantity (for example Quantity1 and Quantity2). Quantity1 column will be assigned to Production content type and Quantity2 will be assigned to Sale content type. With this approach you can specify different column restriction.

At library level means that you will specify column restrictions in library settings for each column separately.

3
  • I don't see that two separate columns are a solution. That will do more harm than good as far as I can tell.
    – Alex
    Jan 11, 2022 at 20:11
  • Based on my knowledge it is only one possible solution for your requirement. It is also solution you have mention in your comment: "It is not possible with list columns I believe, you need to use site columns, Assign it to CT and then at library level in each CT you can modify the default values. Thanks Marek! That worked perfectly. I created a new Site Column > Added to my Content Type > changed the default value to 20%. To test it, I also created a new Site Content Type > added the new Site Column to the new Content Type > set default value to 10%"
    – Matej
    Jan 12, 2022 at 7:15
  • Thanks Matej. I guess we're reading that comment differently as I see no reference to using different columns for the two CT's. It just says to use Site Columns, which I am. But it then sounds like they are changing the default value for each. In the reply, they are referencing the samme "new column" which has different default values under the two CT's.
    – Alex
    Jan 13, 2022 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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