how we can search for the latest record? for examp...
# suitescript
a
how we can search for the latest record? for example lates message to a customer? just the last one
p
Well, it depends on what you mean by “Latest” - that will vary by record type (do you mean transaction creation date/time, transactionid, posting date, something else?).
Anyway, just work out which field you want to use and use a saved search ordered descending and pick the first record
a
creation date time
Is that possible to create a search for customer messages and calls that will show only the latest(creation date) one? so if the latest communication is a call it will show that call and if it's a message it will show that message.
k
The easiest way is to create a saved search in the UI and then export it to SuiteScript using the NetSuite: Search Export extension for Chrome. https://chrome.google.com/webstore/detail/netsuite-search-export/gglbgdfbkaelbjpjkiepdmfaihdokglp
If you can get it in the UI you can pretty much always get it via script
a
@Kris Wood that's the question how to get it in the ui?