<@UJZ0SGH2P> I'll give you a concrete example so y...
# suitescript
b
@Steve T I'll give you a concrete example so you know what to pay extra close attention to. For your first task of
Copy code
a 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)
s
Well. That is my task for tomorrow it seems. Thank you so much for taking the time. I had started to realise the map reduce script was probably the right path. Thank you again.
b
if the field is only to be used to display a value on the customer record and nothing more, you can create a field that is displays the value of a saved search
i personally have never found a use for the feature, but it might fit your requirements. Emphasis on display only, the field is view only on the customer record only