In the Microsoft SharePoint Basis, a lookup industry try a field that is designed to track down their worth away from a field in another listing.
How you relate to the two listings hinges on the point of take a look at. From the browse field’s point Mesa AZ escort review of view, the list that provide information is the mark checklist together with profession where study is inspired by ‘s the target industry. Regarding address list’s attitude, the list containing the fresh research field is actually a connected checklist. The fresh new look profession itself is an associated community.
The SPList class enjoys a GetRelatedFields method that you can use and watch search sphere that time so you can an inventory.
In the interests of convenience, also to end distress, the two lists are occasionally said to has a father-man matchmaking. The little one record gets the search community. The moms and dad listing has got the repository, which is the community that is the address of research community.
List Matchmaking and you may Data Stability
Within the Microsoft SharePoint Foundation 2010, you could arrange a research industry in children record therefore it locations a deletion limitation on the contents of the new father or mother listing. When you manage or modify a search column from the affiliate screen, you have the solution to Impose relationships behavior. For individuals who look for that one, you’ll be able to come across either Limit remove or Cascade delete. Restriction remove prevents a product or service on mother or father list out-of becoming deleted when it is referenced by one or more relevant things regarding kid list. With cascade remove, removing a product regarding the mother record causes all the related situations become deleted throughout the son listing plus.
To enable a comparable decisions when you look at the code, set the new RelationshipDeleteBehavior possessions of an enthusiastic SPFieldLookup target so you can a regard throughout the SPRelationshipDeleteBehavior enumeration, often Restrict or Cascade.
Getting SharePoint Basis to both restrict or cascade deletions, brand new search community need to be listed. Set the new Noted property of the community so you’re able to correct.
Hunt and you can List Matchmaking
The reason for a deletion constraint is to impose referential stability. Your use brand new constraint if you do not require a product or service that has a lookup industry is orphaned because of the leading to a beneficial nonexistent items on the address number.
For example, that is amazing you really have several listings, Users and you can Tackles. You choose to relate the two lists by the addition of a research career called Customers ID to your Address contact information list, and you area the fresh search community for the ID profession within the the clients list. After you configure the fresh new research, you add a constraint toward relationship between the two directories of the indicating one to deletions on Users list need certainly to cascade in order to the fresh Tackles listing. Deciding to cascade deletions enforces referential integrity from the making sure the Address record will not collect orphaned address contact information. While a product or service try erased off Users, related goods are instantly erased away from Details.
Suppose that you also have a good Pending Commands checklist that, such Address, is linked on Users record from the a lookup profession you to things to this new ID job in Users. You might choose you don’t need a customer number to be removed on the People list if for example the consumer provides an excellent pending acquisition on Pending Requests list. In such a case, you could potentially enforce referential integrity of the configuring this new browse career to the Pending Commands to help you limit deletions throughout the mother listing, Customers.
A part-effectation of choosing possibly to help you cascade or to restriction deletions try that the viewpoints out-of look fields are validated when they’re lay. An individual creates a unique goods from the user interface, the fresh new look line is illustrated towards form because of the a decline-down listing in the event your address record provides less than 20 facts; in this situation, the user is bound so you’re able to selecting merely legitimate thinking. In case your address has actually more 20 affairs, a separate control is employed additionally the representative need certainly to style of a good value; in this situation, entering an incorrect really worth contributes to yellow recognition text message on the function. Equivalent validation is completed when you use the item model to set the value of a look industry. In cases like this, in case your given really worth doesn’t suggest a preexisting goods into target listing, SharePoint Foundation sets an exception.