Code
Walk-through
Here we have retrieved the contact entity that the persons that we want to add as members to the static selection belong to. Now we can loop through the person collection of the contact entity and add the persons one by one as members of the static selection. This example only adds persons from one contact, but if you want you may add persons from many contacts as members of a static selection. Also, you can notice the contact ID and the person ID has not been hard-coded, but if you want to this is also a possibility.If you are adding members to a static selection by hard coding the contact ID and the person ID, or if you are getting these values from a user interface input, you must make sure that the person ID belongs to a person that belongs to the contact ID you are specifying for a given
SelectionMemberRow.