In Microsoft SharePoint Base, a lookup career try a field that’s set up discover their really worth out of an area in another list.
How you make reference to the two listings depends on the section out of view. On the lookup field’s views, the list that provide information is the mark record while the career in which the analysis arises from ‘s the address career. Regarding the address list’s viewpoint, the list which has had the brand new look career are a related checklist. The fresh look field itself is a connected industry.
The new SPList class provides an excellent GetRelatedFields means which you can use and discover research areas that time to an email list.
With regard to convenience, and to stop distress, the 2 listings are occasionally considered have a grandfather-guy relationships. The kid number has got the lookup occupation. The father or mother checklist has the databases, the job that is the target of your search occupation.
List Relationships and you will Studies Integrity
Inside the Microsoft SharePoint Basis 2010, you could arrange a research job within the a kid number therefore so it towns and cities a deletion constraint for the items in the newest mother checklist. After you create otherwise modify a lookup column through the member user interface, there is the choice to Enforce relationship behavior. If you come across this package, you can then see either Restrict erase or Cascade delete. Restrict erase suppress a product in the parent record out-of are erased when it is referenced by a minumum of one associated things regarding son record. Having cascade delete, deleting a product in the moms and dad list causes all associated affairs is deleted regarding boy record and additionally.
To allow an equivalent escort service Atlanta decisions into the password, place the fresh RelationshipDeleteBehavior property regarding a keen SPFieldLookup target so you’re able to a respect on the SPRelationshipDeleteBehavior enumeration, often Restriction otherwise Cascade.
Having SharePoint Foundation in order to both limitation otherwise cascade deletions, the brand new research career must be listed. Put the newest Noted property of one’s industry to correct.
Looks and you can Number Relationships
The purpose of a removal restriction will be to enforce referential stability. You pertain the constraint in the event you n’t need a product which includes a lookup industry getting orphaned of the directing so you’re able to a great nonexistent product about target listing.
Such as for example, that is amazing you may have one or two listings, Consumers and you will Details. You choose to connect the 2 directories by the addition of a research profession titled Buyers ID to your Details number, and also you part the newest lookup industry into the ID occupation in the the purchasers number. Once you arrange the lookup, you devote a constraint on relationships between the two lists from the specifying one deletions regarding the People checklist must cascade to the new Tackles listing. Choosing to cascade deletions enforces referential stability by the ensuring that the fresh Details listing does not collect orphaned addresses. And in case a product or service is removed out of Customers, associated products are automatically deleted from Contact.
Suppose that you additionally have a beneficial Pending Commands checklist one, such as for example Address contact information, is linked towards the Customers list by the a lookup field you to definitely items to the latest ID career for the Users. You could potentially choose you never require a customers listing to get deleted in the Customers number if your consumer enjoys a great pending purchase into the Pending Instructions number. In this instance, you might demand referential stability by the configuring brand new research job for the Pending Orders in order to restrict deletions on mother number, Consumers.
A part-aftereffect of opting for either to help you cascade or to maximum deletions was your values out of browse areas are verified while they are set. When someone creates an alternative goods from software, this new browse column are depicted into the setting of the a drop-down listing should your target list enjoys fewer than 20 items; in this situation, the user is restricted in order to wanting only legitimate philosophy. In case the target enjoys more than 20 factors, another handle is employed together with affiliate have to method of an excellent value; in this situation, typing an incorrect really worth results in red validation text message into form. Comparable recognition is done if you are using the item model in order to set the value of a search community. In this instance, when your given worth cannot point out a current item into address number, SharePoint Foundation throws an exception.