During the Microsoft SharePoint Base, a browse job is actually a field which is set up locate their value out of a field in another listing.
How you make reference to the two lists hinges on your area out of take a look at. Throughout the search field’s viewpoint, the list that give information is the goal record and also the occupation where in actuality the investigation comes from is the target industry. Throughout the address list’s point of view, record that has the fresh browse community are an associated checklist. The latest lookup career is actually an associated industry.
This new SPList category has good GetRelatedFields means that can be used and determine research sphere the period so you’re able to an inventory.
In the interests of ease, also to avoid frustration, the 2 directories are now and again thought to features a daddy-man relationship. The kid list gets the look career. This new father or mother checklist provides the databases, the industry that is the target of one’s browse field.
Checklist Relationship and Analysis Ethics
When you look at the Microsoft SharePoint Foundation 2010, you might configure a look job inside children listing thus which metropolitan areas a removal constraint for the contents of the mother or father listing. Once you perform otherwise change a browse line from the representative program, you’ve got the substitute for Demand relationship conclusion. For people who find that one, then you’re able to discover either Restrict delete otherwise Cascade delete. Maximum remove prevents something regarding moms and dad number regarding being erased in case it is referenced from the a minumum of one associated issues from the son number. With cascade delete, removing a product or service regarding the mother record grounds every relevant products as removed regarding kid number plus.
To allow an identical conclusion from inside the code, lay the RelationshipDeleteBehavior possessions regarding an SPFieldLookup object so you’re able to a value from the SPRelationshipDeleteBehavior enumeration, often Restriction or Cascade.
Having SharePoint Basis to either restrict or cascade deletions, the fresh new browse job have to be listed. Set the Listed possessions of your own job so you can true.
Lookups and you may Number Matchmaking
The reason for a removal restriction will be to enforce referential ethics. You implement new restriction in the event you not require a product which has a look career as orphaned by the leading so you can a nonexistent goods about target checklist.
Like, imagine that you have got a couple lists, Customers and you will Address. You determine to relate the two directories with the addition of a browse profession entitled Consumer ID to your Details list, and also you part the latest look industry towards the ID career into the the purchasers number. After you configure this new browse, you put a constraint into relationship between them lists because of the indicating one to deletions regarding Consumers checklist need certainly to cascade to new Details number. Deciding to cascade deletions enforces referential stability by making certain new Details list doesn’t collect orphaned details. Assuming an item is erased out of Users, associated items are automatically removed off Address.
Suppose that you additionally have an effective Pending Orders record you to, such as Addresses, is linked towards the Users record by a look job one items to the fresh ID career when you look at the Consumers. You could pick that you don’t require a consumer listing getting erased regarding the People number if for example the consumer keeps an effective pending buy with the Pending Purchases list. In cases like this, you could potentially impose referential ethics by configuring the new research industry to your Pending Instructions to help you maximum deletions regarding the father or mother list, People.
A side-effectation of opting for often so you’re able to cascade or even to restriction deletions was the philosophy out of research areas is verified while they are set. When someone produces a unique product from user interface, the fresh new look line is represented to the setting by the a drop-off list in the event your target record enjoys fewer than 20 circumstances; in this case, the user is limited so you can finding just valid values. In case the target has over 20 things, another type of control is utilized while the member must type a value; in this situation, entering an incorrect value contributes to red-colored validation text to your means. Comparable validation is carried out if you utilize the thing design so you can put the value of a look job. In this case, when your given worth does not point out a preexisting product on the target list, SharePoint Base places an exception.