0

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.

1 Answer 1

0

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

1
  • Again thanks a lot Commented Nov 26, 2019 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.