Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6778117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:13:44+00:00 2026-05-26T16:13:44+00:00

My Task have multiple relateddocId for example RelatedDoc=3,5,2,6, now i need to add multiplevalue

  • 0

My Task have multiple relateddocId for example RelatedDoc=”3,5,2,6″, now i need to add multiplevalue to the sharepoint lookup fields called related Document which is in task list. how to add this?

For ref see my code below

   private static void CreateItem(SPWeb web, SPList TaskList, string FolderURL, string ItemName, string RelatedDoc)
    {
        var ParentURL = string.Empty;
        if (!TaskList.ParentWebUrl.Equals("/"))
        {
            ParentURL = TaskList.ParentWebUrl;
        }
        SPListItem _taskList = TaskList.AddItem(ParentURL + FolderURL, SPFileSystemObjectType.File, null);
        _taskList["Title"] = ItemName;
        string DocName = "4,6,3,6";//Document ref id.
        SPFieldLookupValue lookupvalue = new SPFieldLookupValue();

        if (DocName != "")
            lookupvalue = new SPFieldLookupValue(RelatedDoc, DocName);
        _taskList["EYRelatedSharedDocument"] = lookupvalue;
        _taskList.Update();

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:13:45+00:00Added an answer on May 26, 2026 at 4:13 pm
    SPFieldLookupValueCollection documents = new SPFieldLookupValueCollection();
    
    foreach ( ... )
    {
        documents.Add(new SPFieldLookupValue(documentId, documentTitle));
    }
    
    _taskList["EYRelatedSharedDocument"] = documents;
    _taskList.Update();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Whats it called when you have multiple task that are very quick to execute
I am new this sharepoint development and i have task in hand to do
I have a task to make a survey to be displayed in SharePoint 2007
I usually have multiple copies of a project, for example: a copy of the
I have a task to create multiple session factories for different Data Sources. One
I'm working on a Java project where I need to have multiple tasks running
I'm currently creating a small todo site, and I have multiple questions related to
TASK : I have an existing xml document (UTF-8) which uses xml namespaces and
Task: I have a camera mounted on the end of our assembly line, which
I have a slow custom data source in a SSIS Dataa Flow Task.I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.