0

I have a column called "Cluster" in a list named "Cluster Assignment". The "Cluster" column/field is of type "choice", the choices are:

Cluster1 Cluster2 Cluster3

I have another column/field called "User" of type "people/group". When a new list item is added a particular user can be assigned to a particular cluster e.g.

Joe Blogs : Cluster 1 Tom Harris : Cluster2 Jill Main : Cluster3

Is it possible to have a workflow that detects changes in "Cluster" values so that no user have the same Cluster value, when Cluster values are changed/updated?

Currently if I change the Cluster value for Joe Blogs to "Cluster3" for example, the Cluster value for Jill Main stays as "Cluster3" and I therefore have to manually change the Cluster value for Jill Main to "Cluster1"

So I would like to know if it will be possible to use a workflow to automate the update process mentioned above....

Any assistance will be greatly appreciated.

Thanks in advance

Dev P
  • 1,017
  • 5
  • 32
  • 54

1 Answers1

1

You should be able to achieve the result you described with a simple workflow, however, I suppose in this case it would be more appropriate to use an event receiver for the list you described.

In the Event Receiver, you can override appropriate method that will be invoked each time any of items on the list is updated.

Just right-click on a list instance in Visual Studio, select Add and choose an Event Receiver object type. This should create appropriate class and automatically bind it to the instance of the list you've selected. Then override ItemUpdated() method to handle the verification and changes of Cluster column to appropriate values. The updated element is available in the ListItem field of the method's SPItemEventProperties parameter.

Links with some information about event receivers that you may find useful:

Community
  • 1
  • 1
Lukasz M
  • 5,285
  • 2
  • 19
  • 28