Discussions

Check out Oracle NetSuite upcoming events and conferences here
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Update your Profile with your Support type to get your Support Type badge.
Expand your NetSuite knowledge by joining our Ask A Guru Live sessions. RSVP on this event now.
Community Poll: What sort of content would you like to see more of?

Item Fulfilment Serial Numbers

edited Feb 21, 2024 5:12PM in Ask A Guru 13 comments

I'm trying to list all the serial numbers that have been allocated on an item fulfilment. I'm trying to do this on an aftersubmit event as below.

define(['N/record','N/search'],

    function(record,search){

        function afterSubmit(context) {

            if(context.type == 'create' || context.type == 'edit'){

                var rec = context.newRecord;

                //Load saved search for serial numbers

                var serailnumbersearch = search.load({id: 'customsearch_wrsinventorynumbersforso'})

                serailnumbersearch.filters.push(['transaction.internalid','anyof', rec.id])

                var serailnumbersearch = serailnumbersearch.run()

                var serailnumbersearch = serailnumbersearch.getRange({start: 0, end: 50});

                //Loop through saved search

                for (var i = 0; i < serailnumbersearch.length; i++){

                    log.debug('Serial Number',serailnumbersearch[i].getValue('inventorynumber'));

                }

            }

        }

        return {afterSubmit: afterSubmit}

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!

Leaderboard

Community Whiz

Quarter 1 (Jan-Mar 2024)

This Week's Leaders

This Month's Leaders

All Time Leaders