Pergunta

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.

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top