Encoding a string in saved search formula function...
# ask-stanley-ai
a
Encoding a string in saved search formula functions
c
AI generated answer (using internal Slack threads):
In NetSuite saved searches, you can encode a string using formula functions. Here are some examples: 1. To replace a string of text in a saved search, you can use the
REPLACE()
formula. For instance, if you want to exclude the prefix "EST" from an estimate search, you can use the following formula:
REPLACE({yourfieldhere},'EST','')
. This formula will replace all occurrences of 'EST' in your field with an empty string. 2. If you want to display a barcode within a formula of a saved search, you can use a downloadable font uploaded to the NetSuite file cabinet. Here is a step-by-step guide: - Navigate to Google Fonts and pick a font. - Download the font and upload it to the NetSuite File Cabinet in the Fonts folder. - Make sure the font is available without login. - Copy the URL field that's on the left side of the form under Description. - Open your saved search and add a Formula (Text) column. - Copy and paste this formula, changing the font-family and URL and reference the File Name of the font you uploaded (minus the .ttf):
Copy code
'<style> @font-face { font-family: *LibreBarcode39Text-Regular*; src: url(*<https://debugger.netsuite.com/core/media/media.nl?id=16264840&c=xxxxxx_SB1&h=59a3697da9e9e4587c01&_xt=.ttf>*)}</style><div style=\"font-family:*LibreBarcode39Text-Regular*;font-size:30pt;\">*'||UPPER({upccode})||'*</div>'
3. If you want to hardcode values in saved searches, you can use the
CASE
statement. For example, if you want to replace the type 'Bill' with the word 'PAYABLES', you can use the following formula:
CASE WHEN {type}='Bill' THEN 'PAYABLES' ELSE '0' END
. This formula will return 'PAYABLES' when the type is 'Bill', and '0' otherwise. ****** 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.826599121
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.815795898
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.814941525
Please provide your feedback on this answer.