none
Joining 2 lists by passing ID from LIST1 to LIST2 RRS feed

  • Question

  • I have a splist called LIST1 and  its id is set as ID , and i need to pass this ID  as a parameter to  second SPLIst, LIST2 where "MeetingID" is the ID column , thats same as ID from LIST1 [ primary key and foriegn key concept  ].

    how to fetch the list items from LIST2 , when i pass a ID from LIST1.?

    Friday, March 17, 2017 10:25 AM

Answers

  • yes, am able to pass the ID from list1 and transfers this ID as a parameter to LISt2 inside my  itemadded() method.

    am doing with runwithelevatedprivielges so, once i get the currentWeb object and i can get the LIST2, by

    currentweb.lists.trygetlist("list2").

    and I use CAML query to this LIST2 and fetch the listitem , that matches the ID column. I will get the listitemcollection froM  LIST2 and  i am fetching few person columns and apply those person. groups with required permissions.

         

       
    • Marked as answer by SaMolPP Monday, March 27, 2017 7:40 AM
    Saturday, March 25, 2017 9:24 AM

All replies

  • Hi

    attach a workflow ( which will start when an item is added ) to the primary list LIST1 which will add a new entry in LIST2 with specific column [MeetingID] = LIST1.ID value

    Let me know if you need more details


    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

    Friday, March 17, 2017 11:00 AM
  • workflow creation is a little bit tough as far as my knowledge is concerned, can you pls provde any other approach that has c# code has involved.

    thnx

    Friday, March 17, 2017 11:30 AM
  • Hi,

    Can you provide a demo about how the whole stuff work in the daily use? I’m not quite sure what the scenario will be.

    I would say this ID of the LIST1 is the GUID of LIST1, is that right?

    Now when users creating a list item in LIST2, you want the GUID of LIST1 to be populated into the “MeetingID” column of the LIST2, right?

    If this is the case, you can set the default value of this “MeetingID” column to the GUID of LIST1 initially, since this GUID of LIST1 is unique and unchangeable.

    Best regards,

    Patrick

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Saturday, March 18, 2017 6:50 AM
    Moderator
  • Hi SaMolPP,

    Any progress now?

    Best regards,

    Patrick


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Saturday, March 25, 2017 5:07 AM
    Moderator
  • yes, am able to pass the ID from list1 and transfers this ID as a parameter to LISt2 inside my  itemadded() method.

    am doing with runwithelevatedprivielges so, once i get the currentWeb object and i can get the LIST2, by

    currentweb.lists.trygetlist("list2").

    and I use CAML query to this LIST2 and fetch the listitem , that matches the ID column. I will get the listitemcollection froM  LIST2 and  i am fetching few person columns and apply those person. groups with required permissions.

         

       
    • Marked as answer by SaMolPP Monday, March 27, 2017 7:40 AM
    Saturday, March 25, 2017 9:24 AM
  • Hi SaMolPP,

    Seems that you have found a solution to your initial question, it would be better to mark the reply as answer for good to other people.

    Best regards,

    Patrick


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Sunday, March 26, 2017 2:13 AM
    Moderator