RE: How to pass last processed record id to reschedule a scheduled script in NetSuite?

I am having trouble in rescheduling a scheduled script. I have created script parameter ‘last_processed_record_id’. I am not aware of how to pass that lastprocessed id in script parameter and run script from where it left.

In my scheduled script, I am processing Invoice saved search results.Please advice!

define(['N/search', 'N/runtime', 'N/record', 'N/task', 'N/file', 'N/format', 
'SuiteScripts/abc/Lib/abc_lib'], function(search, runtime, record, task, file, 
format, lib) {
    function execute(context) {
               processSearchResults();
        var usage= runtime.getCurrentScript();
        log.debug('Remaining governance units: ' + usage.getRemainingUsage());
            }

       //This function fetches saved search data and creates journal entry record
    function processSearchResults(results, scriptid) {
             
            results.forEach(function(result) {
                  var recId= result.getValue({
                    name: "internalid", label: "Internal ID"
                });
            
                var amount = result.getValue({
                    name: "amount",
                    label: "amount"
                });
            })
        }


       //This function updates created  jounal entries on invoice line level custom JE 
field on invoice.
        function updateInvoice() {
    
    }
    return {
        execute: execute
    }
})
Maira S Beginner Asked on December 10, 2024 in SuiteScript.
Add Comment
3 Answers

Can you send a screenshot of the parameters subtab on the script? Make sure custscript_last_processed_id is the correct id.

If that is correct and you log.debugged and it was a blank value then that is the correct value and the parameter is truly blank.

Rookie Answered on December 11, 2024.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.