Question

I have two lists "List A" and "List B"

List B has columns:

Color [Single line of text] Description [Multiple lines of text]

and now how can I get the "Color" and "Description" of the second Item present in the "List B" by triggering an Event Receiver in List A ??

Can anyone please help me ??

P.s : All Items that are present in the List Bhave unique Colors and Description.

Était-ce utile?

La solution

Sample code for your reference.

public override void ItemAdding(SPItemEventProperties properties)
        {


                using (SPWeb oWeb = properties.OpenWeb())
                {

                    SPList oList = oWeb.Lists.TryGetList("listB");
                    SPListItem item = oList.GetItemById(2);
                    object color = item["Color"];
                    object des = item["Des"];
                }


            base.ItemAdding(properties);
        }

enter image description here

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top