Jump to:

22984 Posts in 11765 Topics by 2827 members

General Questions

SilverStripe Forums » General Questions » CsvBulkLoader with retaining dataobject ID

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 212 Views
  • cwchong
    Avatar
    Community Member
    13 Posts

    CsvBulkLoader with retaining dataobject ID Link to this post

    Hi,

    I have extended the CsvBulkLoader to import csv but am having an issue with regards to retaining the original ID of the dataobject imported.

    The csv to import has a column "ReferenceID" but when I provide the following column map:

    public $columnMap = array(
    'ReferenceID' => 'ID',
    //...
    );


    The import creates 2 entries instead of 1 per row of csv, with some data attached to the first entry and other data attached to the 2nd entry (with the correct retained ID)

    How should I proceed to implement the loader with retain of the object ID?

    Thanks!

    212 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.