battk
06/05/2019, 7:43 PMa script that will calculate a customer total sales (cashsales, invoices and credits) and pass the value to a field on the customer record. Weekly.
You will want to create a map reduce script to do your weekly work. There are multiple stages to a map reduce script, but you will probably use the N/search module to search for a list of customer ids that you want processed. For each customer you will be using N/search module to search for the transactions you want to sum and then the N/record module to set the sum.
If you are extra clever, you can probably use joins and summary columns to combine your customer search and the transaction sum. Regardless, the general advice about searches is to make the search in the ui first, and then translate it into code (try using https://chrome.google.com/webstore/detail/netsuite-search-export/gglbgdfbkaelbjpjkiepdmfaihdokglp?hl=en-US)Steve T
06/05/2019, 7:48 PMbattk
06/05/2019, 7:54 PMbattk
06/05/2019, 7:55 PM