This topic contains 2 replies, has 0 voices, and was last updated by johnsongilpp 7 years, 2 months ago.

  • Author
    Posts
  • #18214

    johnsongilpp

    Hi, I’m creating customer and custom records where the parent of the custom record is the customer. I’m extracting the data from an external system and I load the JSON data via a restlet into NetSuite. The issue I’m facing is I can’t set the parent customer field on the custom record with suitescript using the externalid. I can use the internalid; however, NetSuite generates this id and it doesn’t align with the incoming data. Has anyone faced this issue? My solution, which I don’t want to do is to build an array of all the parent customers and run a search on them. Bring the customers back in an array of objects and then search for the internalids that match the externalids. Is there a more efficient way to do this?
    This is a cached copy. Click here to see the original post.

  • #18215

    erictgrubaugh

    Rather than searching *all* Customers first, instead extract all of the external IDs from your incoming data. Use them to search for all Customers with those external IDs, and use those search results to get the appropriate internal ID.

    This way, you’re only doing one search, and that search will only be returning relevant Customers.

  • #18216

    johnsongilpp

    Hi Eric, that’s what my original plan is. I have to process batches of records with some of the batches being over 10k records a batch. I’m not sure that method is going to work. Maybe I’ll pluck a JSON file with all the the external and internal id mappings. I can’t believe NetSuite doesn’t let you just use the externalid for the list/record field.


    erictgrubaugh replied on 08/27/2017, 07:46 AM: Why does the number of records invalidate the approach?

You must be logged in to reply to this topic.