This topic contains 3 replies, has 0 voices, and was last updated by chanarbon 7 years, 9 months ago.

  • Author
    Posts
  • #5717 Score: 0

    Vinayak
    • Contributions: 0
    • Level 1

    Hello everyone,

    I have more than 50000 orders to process using schedule script. I am not understanding how to get such bulk orders in schedule script. Please suggest me what is the best possible solution to process such type of bulk orders.

    Thanks.
    This is a cached copy. Click here to see the original post.

  • #5718 Score: 0

    k_dunc
    • Contributions: 0
    • Level 1

    Hi Vinayak,

    There are a couple things you could do. The first thing you can do is wrap your nlapiSearchRecord inside a loop. I.e., keep running your search whilst the search results ‘length’ = 1,000; or
    Re-schedule your scheduled script after completing each ‘set’ of 1,000 records.

    Depending on what sort of processing you need to do on your orders (i.e., how much usage metering you’re already taking up), then maybe the second option is good enough. Either way, in both of these options, you’ll need to add to your search criteria, a field (something like Internal ID or a custom ‘processed’ flag) so that NetSuite doesn’t keep grabbing the same records each time the search is called.

    Hope that helps.

  • #5719 Score: 0

    michoel
    • Contributions: 0
    • Level 1

    It might be a better idea to use a Mass Update Script instead of a Scheduled Script. The advantage is that governance for a Mass Update Script is per record, so you don’t need to worry about rescheduling your script.

  • #5720 Score: 0

    chanarbon
    • Contributions: 0
    • Level 1

    Agreeing with k_dunc, you may use a better logic of chopping the results into thousands or less and do a rescheduling. You may also perform yield actions in processing. Or you may use SuiteScript 2.0’s Map Reduce to perform the bulk order processing since this use case best suits M/R

You must be logged in to reply to this topic.