how to get expense line memo value through search ...
# ask-stanley-ai
v
how to get expense line memo value through search using script
c
AI generated answer (using internal Slack threads):
To get the expense line memo value through a search using a script, you can use the SuiteScript API's search functionality. Here is a sample code snippet that demonstrates how to do this:
Copy code
javascript
var mySearch = search.create({
   type: "transaction",
   filters:
   [
      ["type","anyof","VendBill"], 
      "AND", 
      ["mainline","is","F"], 
      "AND", 
      ["cogs","is","F"], 
      "AND", 
      ["shipping","is","F"], 
      "AND", 
      ["taxline","is","F"], 
      "AND", 
      ["memo","contains","Your Memo Text"]
   ],
   columns:
   [
      search.createColumn({name: "tranid", label: "Document Number"}),
      search.createColumn({name: "line", label: "Line ID"}),
      search.createColumn({name: "memo", label: "Memo"})
   ]
});
var searchResult = mySearch.run().getRange(0, 100);
This script creates a search on the transaction record type, specifically targeting Vendor Bills (
"type","anyof","VendBill"
). It filters out main lines, COGS lines, shipping lines, and tax lines, leaving only expense lines. It then filters for lines where the memo contains a specific text (
"memo","contains","Your Memo Text"
). The search returns the document number, line ID, and memo for each matching line. Please replace
"Your Memo Text"
with the actual memo text you are searching for. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.818989456
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.813768923
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.813376486
Please provide your feedback on this answer.