Vernita
Vernita

Reputation: 103

Deleting journal created from Time Entries

Is there a way to reverse or void journals created from time entries in Netsuite in bulk? netsuite There are approximately 240 journals that were created in error from time entries.

The delete option is not there (I am in the administrator role) and the 'void time entries' requires you to void entries for specific projects or employees, though you cannot create a saved search and void all journals

Upvotes: 0

Views: 380

Answers (1)

Martha
Martha

Reputation: 764

I am not familiar with JEs created from time entries, but for JEs in general the delete and void buttons are shown when in edit mode. You can also check the custom form on the Actions Tab to make sure Void and/or Delete are available.

You can select to use a specific SuiteScript 2.0 Script Type or run the code below in your browser console to void or delete transactions. Check/confirm that the "Void Transactions Using Reversing Journals" in Account Preferences is set to your liking. Ref: N/record Module, and N/transaction Module.

require(['N/record', 'N/transaction'], function (record, transaction) {
    //array to hold ids to delete. can copy/paste or add logic to get the values from a saved search
    var Ids = [1001, 1002, 1003, 1004, 1005];

    for (var i=0; i<Ids.length; i++){
        try{
            //to delete the JE
            var journalId = record.delete({
                type: record.Type.JOURNAL_ENTRY,
                id: Ids[i]
            });
            //to void the JE
            var journalId = transaction.void({
                type: transaction.Type.JOURNAL_ENTRY
                id: salesOrderId
            });
            console.log('Record deleted: ','i value: ' +i +', rec: '+journalId); 
        } catch(e){
            console.log(e.name, e.message);
        }
    }
    console.log('done, # of recs updated: ', i);
});

Upvotes: 1

Related Questions