Insert items in list fastly

Hi,
Using SharePoint object model is there is any way to bulk insert items in list fast.
I have 10000 records.
Thanks,
Siva.

Hi ,
you can use batch insert method.
ProcessBatchData() method of SPWeb.
here is example for ProcessBatchData():
ProcessBatchData method takes XML format as input and it will directly communicate with SharePoint content database. <m:smallfrac val="off"><m:dispdef><m:lmargin
val="0"><m:rmargin val="0"><m:defjc val="centerGroup"><m:wrapindent val="1440"><m:intlim val="subSup"><m:narylim val="undOvr"></m:narylim></m:intlim></m:wrapindent><m:smallfrac
val="off"><m:dispdef><m:lmargin val="0"><m:rmargin val="0"><m:defjc val="centerGroup"><m:wrapindent val="1440"><m:intlim val="subSup"><m:narylim val="undOvr"></m:narylim></m:intlim></m:wrapindent></m:defjc></m:rmargin></m:lmargin></m:dispdef></m:smallfrac></m:defjc></m:rmargin></m:lmargin></m:dispdef></m:smallfrac>
StringBuilder query = new StringBuilder();
query.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Batch>");
for (int itemCount = 0; itemCount < 100; itemCount++)
query.AppendFormat("<Method ID=\"{0}\">" +
"<SetList>{1}</SetList>" +
"<SetVar Name=\"ID\">New</SetVar>" +
"<SetVar Name=\"Cmd\">Save</SetVar>" +
"<SetVar Name=\"{3}Title\">{2}</SetVar>" +
"</Method>", i, listGuid, someValue, "urn:schemas-microsoft-com:office:office#");
query.Append("</Batch>");
spWeb.ProcessBatchData(query.ToString());
http://bharatpandey.blogspot.in/2012/11/bulk-insert-updatedelete-items-in.html
http://apmblog.dynatrace.com/2009/01/20/sharepoint-using-batch-updates-to-speed-up-performance/
Regards,
Rajendra Singh
If a post answers your question, please click Mark As Answer on that post and Vote as Helpful
http://sharepointundefind.wordpress.com/

Similar Messages

  • Inserting items into List on a JSP

    I want to insert new items into a multiple select list from database
    on selecting an item from an existing list in a JSP.
    I am not sure how to do this.
    thanks

    This is basically performing partial page rendering. There is no way for HTML or JavaScript executing in a user's browser to communicate directly with Java or your database. You'll either have to "preseed" the values from the database into the HTML page using JavaScript, and then change the select list w/ JavaScript based on what the user selects (this is how it's usually done.)
    Or, you could do something like using a hidden IFrame as a data conduit to your JSP which sends JavaScript back to the browser and updates the select list with the new values. A little more tricky, and doesn't work w/ all browsers, but it would work better if the data in question can be arbitrarily large.
    Hope that helps.

  • Inserting ordered/unordered list items breakes the document design

    Hi,
    I use JEditorPane to edit HTML document. When I insert ordered/unordered list items, it breakes the design of the document. For example, I have next peace of the document:
    <center>
    This text is centered.
    One more line...
    </center>
    after inserting list item between text lines, document looks like :
    <center>
    This text is centered.
    </center>
    <ol>
    <li>
    </li>
    </ol>
    <center>
    One more line...
    </center>
    Note, that center tag is closed before list item and opened after it.
    Is it possible that inserted list items will save the original design of text around ?
    Thanks.
    .Vlad.

    Change the Leading in the Character Pallet to a smaller number, and increase the Space After in the Paragraph Pallet.
    The space between lines in the same paragraph is the leading, the space between paragraphs is not leading, and trying to achieve it with the leading field always creates more problems than it solves.

  • Help needed in removing duplicate items of list box  in java

    How to remove duplicate items of list box while dynamically inserting (on-click event)
    It is not identifying duplicate data
    Variable name is HP_G1
    HP_dmg1 = (DefaultListModel) HP_G1.getModel();
    int a = HP_G1.getModel().getSize();
    System.out.println("HP list no--------> "+a);
    if(a!=0)
    for (int j=0; j<a; j++)
    String item1 = String.valueOf(HP_List.getModel().getElementAt(j));
    System.out.println("HP list added--------> "+item1);
    if(HP_dmg1.equals(item1)){
    HP_dmg1.remove(j);
    else
    HP_dmg1.addElement(GPL);
    }

    Your code is unreadable, so I'll ignore it. In the future please press the message editor's CODE button to format code.
    As to your problem, to the point you normally use a Set instead of List when you don't want duplicates in a collection.

  • How to set index in combo box to newly inserted item

    I have the following code:
    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
            If categoryString = "New" Then
                newCategoryString = InputBox("Enter new category name", "New Category")
                ComboBox2.Items.Add(newCategoryString)
                categoryString = ComboBox2.SelectedItem
            End If
        End Sub
    The combobox has the following collection of items
    Business
    Personal
    Home
    Vehicle
    Social
    New
    When the user selects New, the msgbox pops up  and the user enters the new category.  After choosing, the selected item defaults to New.  How can I determine the index of the newly inserted item?  I am using VB 2008 Express.
    Best regards,
    Randy Boulter

    Hi
    Here is my take on the question. This inserts the new item above the last item("New"), and gets the index accordingly. This keeps the "New" item at the bottom of the list.
    Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox6.SelectedIndexChanged
    Dim cb As ComboBox = DirectCast(sender, ComboBox)
    If cb.SelectedItem.ToString = "New" Then
    Dim newCategoryString As String = InputBox("Enter new category name", "New Category")
    cb.Items.Insert(cb.SelectedIndex, newCategoryString)
    Dim newitemindex As Integer = cb.Items.IndexOf(newCategoryString)
    End If
    End Sub
    Regards Les, Livingston, Scotland

  • Automatic Selected Item of List Builder Component Does not work (anymore)

    Hi all,
    Í'm working with Xcelsius Engage 2008 (version 5.3.2.0) and the automatic selection of an item at runtime of the list builder component does not work anymore. In a previous version it worked very well.
    Here's the case: at runtime I want that the list builder component automatically puts the first item in the list to the destination section and selects it, so that a graph can show the underlying pushed data. In the previous version it worked o.k., but now at runtime the destination section remains empty at startup. If I interactively select an item from the source section to the destination section and update the list builder, the data is shown correctly, but it must done automatically, which worked o.k. in an earlier version of Xcelsius 2008...
    This are my settings of the list builder component (which was running correctly earlier..):
    -at the general tab I defined a range of labels
    -at the general tab I defined 2 data column insertion series
    -at the behaviour-common tab I defined selected items: position mode; items: the first item of the label list; insert items at runtime
    -all of the data comes from an external xml data source
    You can find an example of the visualisation at: http://onderzoek2.evinet.nl/projecten/10169/dynarap.htm. You will see that at start-up there is no item visible and selected in the destination section of the list builder....
    I've tried every combinations of settings, build up the component from scratch, but its not working (anymore).
    Greetings Erik-Jan Vriens

    Hi njnits,
    Print view button is a standard component of Xcelsius: look at it in the IDE
    Exporting to Powerpoint is also a standard functionality, so yes. For this particular dashboard/report all data resides in an external xml-file which have to be accessible for Powerpoint
    All visualisations, not only the table,  in this/report fetch their data from an external xml-file, but a QaaWS-connection will also do the trick. You will have to write this dedicated service. In our case the xml-data is also generated automatically.
    The external data is best defined as a sort of matrix, consisting of approx. 100 columns by 1000 rows. I agree it takes a lot of Xcelsius but it does the job....
    Hopes this info helps....

  • SharePoint Btach Process with List string items into list

    Hi 
    I have a List<string> with 8000 elements.
    I need to take 1000 everytime and run the batch process to insert data into list.
    I cant apply all 8000 items in one shot.
    Can you please suggest me that how  i can query List<string> and execute.
    Thanks
    Siddartha

    You need to use Skip and Take methods of your object collection.
    Example:
    list.Skip(1000).Take(1000)
    This would skip the first 1000 and take the next 1000.
    You'd just need to increase the amount skipped with each call
    List<string> list = new List<string>();
    //Code to get 8000 elements
    for (int index = 0; index < 8; index++)
    List<string> batchList = GetBatch(index, list);
    //Code to insert data into list
    And here is the GetBatch method...
    public List<string> GetBatch(int pageNumber, List<string> list)
    return list.Skip(pageNumber * 1000).Take(1000);
    I found the answer
    here.

  • BADI for inserting items in ME51N

    Hi
    Which BADI do I use to insert items creating a purchase requisition (ME51N)?
    Thanks in advance.

    Check this badi..
    ME_BAPI_PO_CUST      Customer BAdI for BAPI_PO_CREATE1 and BAPI_PO_CHANG
    ME_BAPI_PR_CUST      Customer BAdI for Enjoy Purchase Requisition BAPIs
    next go to t-code Se15>expand the enhacement tab>enter package(ME) under Badi's tab and
                                                         execute you will get the list of Badi's
                                                         available...
    Prabhu
    Edited by: Prabhu Das on Jun 1, 2009 7:17 PM

  • By using Inspector, i found the way to create and insert a scrolldown list ; however the list has to be created from  inserting each line at a time; what i am looking for is a way of creating a scrolldown  large(30 to 100 lines) list.

    By using inspector, i found a way to create and insert a scrolldown list (*) in a cell ; however it can only be done one line at a time .what i am looking for is to create a bigger scrolldown list ( from 30 to 100 lines ) and in excel we can do it by copy and paste from an other doc...there must be a way with Numbers !!! any ideas ?
    (*)...go to inspector/4th icon to he left/format/local menu/and then input the list one by one...and it creates a scrolldown list where you cursor was located in numbers.
    please help....

    If you need to use this kind of objects, my guess is that it would be better to use an other application like libreOffice.
    At an user request, I wrote an AppleScript grabbing the list from a table embedded in the Numbers document.
    Here is an enhanced version.
    --{code}
    --[SCRIPT fake-scrolldown-list]
    Enregistrer le script en tant que Script : fake-scrolldown-list.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Utilisateurs:<votreCompte>:Bibliothèque:Scripts:Applications :Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Sélectionner une cellule dans une table d'un document Numbers.
    Aller au menu Scripts , choisir Numbers puis choisir “fake-scrolldown-list”
    Le script extrait la liste d'articles de la table « la_liste » de la feuille contenant la table ci-dessus.
    Il demande de choisir un article puis dépose celui-ci dans la cellule sélectionnée.
    ATTENTION : À la demande d'un utilisateur, Le script utilise un nom de table localisé.
    Je n'aime pas cela parce que de ce fait, lorsque le script est utilisé sur un système Français,
    il requiert une table nommée "la_liste" mais lorsqu'il est utilisé sur un système Anglais il requiert la table "the_list".
    --=====
    L’aide du Finder explique:
    L’Utilitaire AppleScript permet d’activer le Menu des scripts :
    Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case “Afficher le menu des scripts dans la barre de menus”.
    Sous 10.6.x,
    aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
    puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
    --=====
    Save the script as a Script: fake-scrolldown-list.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Select a cell in a table of a Numbers document.
    Go to the Scripts Menu, choose Numbers, then choose “fake-scrolldown-list”
    The script extract the list of allowed items from the table “the_list” which must sit in the same sheet that the table embedding the selected cell.
    It urge to choose an item then insert it in the selected cell.
    CAUTION : I use different names for the required table according to the language in use on user request.
    I dislike this feature because a document built by a French user sent to an English one will fail.
    On the French system the script ask for the table "la_liste" but it ask for the table "the_list" on an English system.
    --=====
    The Finder’s Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the “Show Script Menu in menu bar” checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/12/31
    --=====
    on run
              local dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2, myListe, maybe
              set {dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
              tell application "Numbers" to tell document dName to tell sheet sName
    Extract the list of allowed values from the dedicated table *)
                        if my parleAnglais() then
                                  "the_list"
                        else
                                  "la_liste"
                        end if
                        tell table result
                                  set myListe to value of every cell of column 1
                        end tell
                        set maybe to choose from list myListe
    If we select the Cancel button, exit silently *)
                        if maybe is false then error number -128
    Fill the selected cell with the choosed value *)
                        tell table tName
                                  set value of cell rowNum1 of column colNum1 to (item 1 of maybe as text)
                        end tell
              end tell -- Numbers…
    end run
    --=====
    set { dName, sName, tName,  rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    on get_SelParams()
              local d_Name, s_Name, t_Name, row_Num1, col_Num1, row_Num2, col_Num2
              tell application "Numbers" to tell document 1
                        set d_Name to its name
                        set s_Name to ""
                        repeat with i from 1 to the count of sheets
                                  tell sheet i to set maybe to the count of (tables whose selection range is not missing value)
                                  if maybe is not 0 then
                                            set s_Name to name of sheet i
                                            exit repeat
                                  end if -- maybe is not 0
                        end repeat
                        if s_Name is "" then
                                  if my parleAnglais() then
                                            error "No sheet has a selected table embedding at least one selected cell !"
                                  else
                                            error "Aucune feuille ne contient une table ayant au moins une cellule sélectionnée !"
                                  end if
                        end if
                        tell sheet s_Name to tell (first table where selection range is not missing value)
                                  tell selection range
                                            set {top_left, bottom_right} to {name of first cell, name of last cell}
                                  end tell
                                  set t_Name to its name
                                  tell cell top_left to set {row_Num1, col_Num1} to {address of its row, address of its column}
                                  if top_left is bottom_right then
                                            set {row_Num2, col_Num2} to {row_Num1, col_Num1}
                                  else
                                            tell cell bottom_right to set {row_Num2, col_Num2} to {address of its row, address of its column}
                                  end if
                        end tell -- sheet…
                        return {d_Name, s_Name, t_Name, row_Num1, col_Num1, row_Num2, col_Num2}
              end tell -- Numbers
    end get_SelParams
    --=====
    on parleAnglais()
              local z
              try
                        tell application "Numbers" to set z to localized string "Cancel"
              on error
                        set z to "Cancel"
              end try
              return (z is not "Annuler")
    end parleAnglais
    --=====
    --[/SCRIPT]
    --{code}
    Yvan KOENIG (VALLAURIS, France) samedi 31 décembre 2011
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : http://public.me.com/koenigyvan
    Please : Search for questions similar to your own before submitting them to the community
    For iWork's applications dedicated to iOS, go to :
    https://discussions.apple.com/community/app_store/iwork_for_ios

  • Código de item da lista de serviço - Salvador

    Boa tarde amigos,
    Estamos no meio de um projeto de implementação de NFSe, e por incrivel que pareça estamos obtendo êxito, porém no meio desse caminho, há uma série de mapeamentos de campos referente aos respectiavos municipios dos quais, estão nos dando um pouco de dor de cabeça.
    Para que fiquei mais claro a minha duvida, neste momento estamos mapeando Salvador, e no nosso cliente existe uma tabela contendo sua lista de serviço. Essa tabela deve ser linkada com as das prefeituras que são emitidas as notas, neste caso Salvador. O campo que nos pede essa informação é o tsItemListaServico C Código de item da lista de serviço 5 do manual de integração.
    Gostaria de saber de vocês se alguém possui/jáviu ou sabe, se esta lista é especifica para Salvador ou é como a Nacional, aparentemente esta aqui - http://www.usp.br/gefim/manuais/CodigosISS.htm
    Bom estamos mapeando agora Salvador mas depois partiremos para Recife, RJ, BH e Curitiba, estou deixando aqui citado, porque caso haja mais dessas listas.
    Enfim acredito que seja somente isso, agradeço a atenção de vocês desde já!
    Vitor Grassato

    Fernando mais uma vez obrigado pela dica.
    Venho aqui informar que cadastrei no SAP os códigos que foram definidos junto ao fiscal da empresa quais melhor se encaixavam com as descritas nos manuais das prefeituras.
    No proprio site de cada prefeitura em seu campo Legislação há uma lista diferente para ser atribuida junto aos tipos de serviço de cada empresa.
    A que mais me chamou atenção foi RJ, que possui cerca de 6 digitos para o campo do manual da ABRASF que é de 5 digitos, lçogo é necessario fazer uma alteração no XML caso vc queira implementar no municipio de RJ.
    Do mais o Fernando ja exemplificou!
    Agradeço a todos a colaboração e boa semana!

  • Vendor open items aging list - Reg.

    Hi,
    My client is requesting a transaction in SAP which can be used to produce a Vendor open items aging list and the output should be exactly the same as it is for the Customer open items aging List (transaction S_ALR_87012178). Moreover, It is essential for him to have only one line per vendor. He does not want to  find a report in the accounts payable side that looks like the one which he mentioned for the accounts receivable side.
    Since this is an urgent ticket, can any body help me in this regard.
    Thanks,
    Prasanna
    Moderator: Please, search before posting

    Dear expert
        Reference from sdn forum
    You can customize the vendor report to show the items overdue per vendor by using the following steps
    1. Create a form using T Code - FKI4
    In this form ( two-axis structure) provide the details for each column as per your Client requirement - Due from 0 - 30 days
    etc. You can create a column (using formula method) at the end by adding the previous columns, this will give you total
    amount of overdue items for each vendor
    2. Create a report using T Code - FKI1
    Based on the Form created in the above step. Make additional selections based on client requirements like document type,
    company code, account type, currency etc. Execute the report.
    The following link will give provides detail steps for the creation of the aforementioned form and report.
    Re: AR aging report (summary by customer)
    Vendor Aging Report
    Regards
      Ajeesh.s

  • Calendar displays different items in list vs day/month view

    I have a strange problem. When viewing my Calendar items in List view, the items are all wrong for the day. But in Day & Month view they are correct.
    I have tried resetting my sync history, and also removing all items, then checking the replacing items on ipod with Outlook calendar box, but it didn't fix it. It was correct until this last sync.
    Any help would be appreciated.
    Thank you.
    Message was edited by: SpyglassSally

    I figured out how to fix it so it displays the same events, no matter the view, but I can't tell you why it works. Maybe someone else can? So in case anyone else gets this, here's what you do:
    With Calendar open, click on Calendar in the upper left corner. Deselect Birthdays so only Calendar has a check by it.
    For some reason, that fixes it.

  • Allow user to select each item in list item only once.

    Hi,
    What is the best way to go to stop the user selecting the same item in a list item more than one.
    I have a multi record block, the user can select values 1-10 for each record, but they should not be allowed to select duplicates.
    Thanks for any help!

    Hi,
    Suppose you have 4 list items A,B,C,D in block "test" and same 4 values in each list item. Now you want that, no two values selected by user in list item should be same.
    On when-validate-item of list item B write code like :
    If :test.A is null then
    Message('First A must be enter");
    Raise form_trigger_failure;
    end if;
    If :test.B = :test.A then
    Message('value already in list item A');
    Raise form_trigger_failure;
    end if;
    Now, for C same code with a addition of condition for B with OR operator like:
    If :test.C = :test.A or then :test.C = :test.B
    Like that.... you can achive your functionality.
    But one restriction is that user has to enter values in list item in a pre-defined order only....
    Hope that it would work for you.....

  • After adding list view into the web part page, the items and list control ribbon is not activated.

    I created new webpart page and added one list view web part into the page.
    However I can see the ITEMS and LIST tabs on ribbon area, but all the buttons are deactivated.
    Do I have to activate any feature for this or any settings are needed for the webpart?
    I already have full permission for this site.
    For your easy understand I added the screenshot.

    Thanks for you advice.
    However I am currently using the context menu and edit link in the view.
    My Client keep complaining about the ribbon is not activated even thought it works fine in the SharePoint 2010.

  • Create document item from list, then no lookups

    SharePoint 2013: I have a content type set up in a document library with a default document template attached (in this case an excel workbook file).
    In SPD 2013 (using a 2010 workflow), I can use the "Create Item in List" function in SPD from an adjacent list on the same site collection to create a record in the document library, and set the content type such that when the workflow is done there
    is indeed a new document waiting for me in the doc library, utilizing the expected template file.
    The issue:
    The output of the "Create Item in List" function is the ID of the item created.  Using the Create variable, I believe I should be able to immediately lookup attributes of the newly created Document item, such as the last modified date and URLs.
     I'm doing the lookups within the output of a Log (to workflow history) function.  However, certain fields always come back blank.  Performing the same lookup, using a known Document item ID (created in another w/f session) is successful.  It
    would be nice to email out a URL of the file I just created from the same workflow.
    I've tried having the W/F wait up to 5 minutes, but it appears that certain attributes cannot ever be retrieved in the same workflow, while others can indeed be retrieved (GUID of the new doc is successful, for instance).
    I've read some online debate related to this, but I can't find anyone having the exact same issue as me, nor explain why it's happening.  It seems like it should be so straightforward.  Any ideas?  Thanks!

    Hi,
    According to your description, my understanding is that you create a document library item using “Create item in list ” action and when you log some certain attributes of the item to workflow history list, then
    it has no value.
    I try to reproduce this issue with your steps and it works as expected in my environment.
    For a better troubleshooting, I suggest you do as the followings:
    1. Check if the certain new created item field has value in the list which always return blank.
    2. I suggest you can create a new simple workflow to log the field data for new created item to workflow history list to test if it works.
    3. If the issue still exists, I suggest you can track the workflow using Fiddler. You can see detailed web request for the workflow, it will be easier to find the cause of this issue.
    Here is a detailed article for your reference:
    http://msdn.microsoft.com/en-us/library/office/dn508412(v=office.15).aspx
    Best Regards
    Jerry Guo
    TechNet Community Support

Maybe you are looking for

  • K7N2 Delta MS6570 and JUSB2 header.

    I have a K7N2 Delta MS6570 Mobo and when I first obtained it I installed it into an Antec Sonata case. This has, among others, two USB sockets on the front. These can be connected by two sets of four separate connectors. I tried using these but found

  • Library cannot be saved

    I receive the message "The iTunes library cannot be saved. An unknown error occured (-50)" while watching a video podcast. Once I get this message, I usually lose my video as the podcast continues to play. iTunes usually will crash and I need to rest

  • Problems on Installing Sun ONE Studio 5 update1, Standard Edition

    I'm on a win x64 rig(amd x2 4400) with both 32 bit and 64 bit versions of the latest 1.5 jdk's + the runtime ofcourse. On startup of the installer I get: A suitable JVM could not be found. Please run the installer again using the option -is:javahome

  • Nokia N8 WLAN problem

    Hi all,  Sorry if this has already been covered! I'll keep it simple....Nokia N8, had it connected to my home broadband router yesterday no problems, disconnected it overnight and today when I go to the 'WLAN wizard' section (in settings), it shows m

  • Reporting in SCCM 2012

    HI all, I have been trying to set up reporting for about 3 weeks now and are just about to give up, I'll give a quick run through of everything I have done. 1. I went through all the steps for both configuring the Reporting Config Manager and then ad