I love NetSuite Saved Searches. Especially the way you can schedule reports to run and distribute via email according to one or more column names representing a person such as a contact, employee, customer, etc.
One challenge is situations where the saved search output does not supply a hyperlink back to specific NetSuite records. The most prominent example is when you create NetSuite summary saved searches. So here is what you need to do to get hyperlinks in those saved searches:
Add Hyperlink as a NetSuite Saved Search Formula Field
- Get the hyperlink to any target record you are seeking to link to. For example, this link will take you to customer records: https://system.netsuite.com/app/common/entity/custjob.nl?id=17476 We are going to work to replace 17476 in our example with the ID you need.
- Create a Saved Search Result based Formula Field (Text).
- Determine the field that has the internal ID of the record you are after. It typically is {internalid}. However, if the data is in a join from another related table, it may look something like {customer.internalid}.
- Follow the text design pattern below depending on the type of search you are creating.
NetSuite Standard Detailed Output Saved Search
'<a href=https://system.netsuite.com/app/common/entity/custjob.nl?id=' || {internalid} || ' target=_blank>Link</a>'
NetSuite Group By Summary Output Saved Search
NVL2({customer.internalid}, '<a href=https://system.netsuite.com/app/common/entity/custjob.nl?id=' || {customer.internalid} || ' target=_blank>Link</a>', '')
Addendum 2023
Note, since I authored this article over 10 years ago, in 2012, NetSuite now demands that you use “Formula (HTML)” fields versus Text to make this technique work. Be sure to have the “Disable Html In Search Formula (Text)” set to Off in the Setup –> Company –> General Preferences.
If you found this article relevant, feel free to sign up for notifications to new articles as I post them. If you need assistance with your advanced saved searches, let’s have a conversation.


I can’t say how to make it better, but what would be better if there was some way of determining the context of where the saved search was being invoked, in order to keep the base part of the url correct. As it is, one would have to modify the saved search when moving from a sandbox to live environment (i.e. changing the base part of the url from https://system.sandbox.netsuite.com/ to https://system.netsuite.com/)
That’s a good question. We could implement relative URLs (such as /app/common/entity/custjob.nl?id=) for the definition but then if you email out the report, it won’t link back.
Marty
I have created Saved Search and added Hyperlink to one of the field using formula(text). But whenever i am trying to export that results, it is giving me complete anchor tag details as a text. Is their any workaround to export only link text and not the complete anchor tag details.
Can I see your formula? Where are you trying to display the results?
Marty
Hi, much appreciated for this info. I’m also hoping when export to excel or pdf, it will not showing the full text of the link.
secondly i’m wondering at the end of the sentence target=_blank>Link. could you change the text Link to one of the field? for example the text “Link” changed to a tracking number of shipment from one of the field
Thanks and much appreciated your help in advance
Yes, you can place anything you want in the crafting of the URL. The trick is to be clear on how to craft a URL and then to place variables in the right place.
Marty
Thank you so much Marty! I have been struggling with links in grouped searches and this has solved my problem. In this case I provided the links within a detail column, using two of your posts. We had turned on multi-locations and were trying to create a search displaying items that had inventory available in the non-preferred location and where there were backorders in the perferred location. We ended up using this formula successfully to show the orders that were backordered:
” || REPLACE(NS_CONCAT(TO_CHAR(case WHEN {locationquantitybackordered}>0 THEN ‘‘ || {transaction.number} || ‘‘ ELSE NULL END)), ‘,’, ”) || ‘</d
Hi Marty,
Not sure if you can help – but I’d really appreciate it. I’ve just launched a new VOIP system that has the ability to ‘pass’ the caller ID to Netsuite with a variable – but I can’t figure out the Netsuite URL (where “%P” would be the phone number I want to search in Netsuite). Any suggestions?
Thanks in advance.
Hi Jordan,
Yes. Have you activated the Telephone feature in NetSuite? Under preferences, you can setup the reference phone number with the {phone} parameter. Here is a link to snapshot:
https://blog.prolecto.com/wp-content/uploads/2015/11/netsuite-cti-telephone-parameter-prolecto-20151101.png
Hi, I was curious if there is a simple formula for populating the results in a column in a saved search results.
More specifically. We have a comparison shopping product feed. I would like to have the results column include our account number. I would rather not create a custom field and populate all 5K item records if I dont have to.
I would like to do it with a Text formula. Then have the formula include the value that will be displayed in the column.
Thanks in advance for the help.
Hello Chad,
Did you see this article? It sounds like this may be closer to what you are looking for:
https://blog.prolecto.com/2014/05/16/reveal-both-aggregate-and-detail-in-netsuite-saved-search/
Marty
I used the link you posted aboved to link to another saved search.
in both search we are using a unique SN(serial number)
I would like to click on the row of a certain SN to access the second search looking for this specific SN.how can i achieve it?
Thanks in advance for your help.
Hi Mike,
I would have to inspect the HTML of the target hyperlinks to see if we could craft the data needed. They key is to learn the way NetSuite crafts the hyperlink. Fortunately, there is typically easy to understand parameters. I play with them all the time to learn. Once you have that, then you have to hope you can get to the data via Saved Search. Once you solve that, the technical part can be done to get the link right.
Marty
Hi Marty,
Is it possible to open customer link(which is standard) on sales order in a new pop window.
Yes. This is what this article is suggesting. But you need to modify the view that you are seeing from the standard output to create the custom formula. Then make that view Preferred so that your users see it versus the default.
I see the question asked in the comments twice, but I am cannot find an answer. When exporting a saved search with a formula text hyperlink, it shows the text in excel, it does not display it as a link. This effectively makes the link only helpful when linking directly off the search. In the case of sending out the search as a scheduled task, it becomes a useless column. Then in my case, I have to send the search results via email because otherwise it will timeout, so I the link never does me any good. Is there a workaround? Here is my formula (text) Maximum:
case WHEN {type} = ‘Inventory Item’ THEN ‘Edit ‘ || {name} || ‘‘ ELSE ” END
Hello Emily,
Since you are exporting for NetSuite, have you tried just outputting the hyperlink as a string? I believe Excel will import that and you can specify the import type as hyperlink.
Marty
Hi Marty,
while exporting saved search from NetSuite i want to display image hyperlink as a image in excel sheet.
Can you please help me with out using macros how to display hyperlink as a image
Hello Sravanthi,
The best I can say about Excel is that you can output your document as HTML and then, if structured well, you can import that HTML with your images. Otherwise, it is about importing the hyperlink and then working excel to display that image with macros or other functions.
Marty
This has been extremely helpful in so many situations. Thank you for sharing this!
Recently, however, it seems to prompt for a login when I use the link before proceeding to the record even when though I was logged in to view the search results. Any thoughts on how this intermediary step of logging in again each time can be avoided?
If this persists, contact NetSuite support. Something may be off in the infrastructure.
Hi Marty,
From a saved search column, can i link another saved search.
So for example, In Events view, I am getting registration count as a column with value as 5 and now if I will click on 5 then in other popup, I should get details of those 5 users. Please let me know if this is possible and if yes then please share steps to do same.
Mayank,
I suspect this could be done. There are options. Consider this article which will return a comma separated list of values that may help you drive your popup. https://blog.prolecto.com/2014/05/16/reveal-both-aggregate-and-detail-in-netsuite-saved-search/
Also, we solve all kinds of linked saved search challenges with our Content Renderer Engine. See this article: https://blog.prolecto.com/2016/05/18/how-to-insert-multiple-netsuite-aggregate-saved-searches-to-google-charts/
Marty
Hi Marty,
Have you had any experience doing html formatting of Saved Search results? I’ve found some resources on how to format single cells (highlighting, bolding, etc.) in search results, and they work great, but I can’t seem to find a way to apply those rules to summarized (sum, group, etc) results.
Is there a way to apply formatting to summarized results?
Hi James,
It may indeed be possible to get HTML in the aggregates if the values represent constants and the groups come together. Further, these days, we heavily leverage our Content Renderer Engine to solve all of our complex HTML and Saved Search concerns.
Thanks Marty,
this solution saved my time.
Hi Marty,
I was wondering if it’s possible to show the link as a field name in NetSuite
In your example you have
” target=_blank>Link’
I was wondering if it’s possible to do
‘ target=_blank> {interalid} ‘
or another field to add a descriptor to what the link is for
Thanks for your help!
Yes, you can put anything you need to in the place for the HTML that will show to the user.
Is there a trick to do that? Whenever I put a field in, it always ends up showing “{internalid}” instead of the result of the field.
You need to careful about your delimiters. Thus, finish your strings with a single quote and then add the pipe symbol (||) to concatenate. Here is a reference article.
Thanks Marty,
If anyone on your site is interested in the working url I made
'' ||{custrecord_hr_action_employee.custrecord_hr_action_type} || ' Ends ' || {custrecord_hr_action_employee.custrecord_hr_action_end_date} || ''
Hmm, sorry about that.
Here’s a link to an external post
https://graph.org/NetSuite-URL-12-19
I am trying to create a URL link in a saved search in NetSuite for Cost of Sales. The cost of sales search pulls all transactions regardless of type (i.e., Credit Cards, Bills, Expense reports, etc.). However, depending on the type, the URL link to the transaction needs to change for it to link correctly. For example, Bills will have a URL with vendbill (app/accounting/transactions/vendbill.nl?id=484446&whence=) and credit cards will have cardchrg (app/accounting/transactions/cardchrg.nl?id=485330&whence=).
Is there way to write the formula so the URL will have the correct type in the link?
Hello Robert,
If you perform a native transaction search and expose document number, you will get a link such as: https://556677.app.netsuite.com/app/accounting/transactions/transaction.nl?id=95877 This “app/accounting/transactions/transaction.nl” will automatically redirect to the right transaction type which I believe you seek. Does that not work?
Marty
FIRST: thanks for the tip!
SECOND: If you want the link to look the same as NATIVE NETSUITE LINKS, just add class=”dottedlink” into the tag. (tested on release 2019.1)
EXAMPLE: NVL2({customer.internalid}, ‘<a class="dottedlink" href=https://system.netsuite.com/app/common/entity/custjob.nl?id=' || ….
This way users won't wonder why the custom links look different than the standard ones they are used to seeing.
Hi Brent,
Thank you! This is a nice enhancement.
Marty
Thanks for the tips Marty! I tweaked this to get default images.
‘https://www.url.com/images/’ || case when ({parent} is NULL) then {image_prefix} else {parent.image_prefix} end || ‘_01.default.jpg’
Hi Marty, thanks for the tips on cust. hyperlinks.
Could I ask pls how to set the Formula in case I want to use the hyperlink also in Suitelet?
I mean if I create Suitelet out of the Saved Search, which includes this custom hyperlink, I want to see clickable link also in that Suitelet. What I see now is just the text of the Formula.
thx in advance
Hello Nevo,
This is basic SuiteLet programming. Have you tried to create a HyperLink type or an inline HTML field to display on your SuiteLet?
Marty
Hey Marty, I was wondering if there is a way to have the link run without opening a new window?
Hello Mathew,
Yes, do not put the target=_blank attribute in the link definition and that should open the hyperlink in the same window.
Marty
Thanks Marty!
Hi Marty,
yes I tired also these two custom fields before.
HyperLink field is again displayed as just text, not clickable link on SuiteLet.
Inline HTML field cant be even added into RESULTS on Saved Search.
Thx in advance for your further ideas.
Nevo
Is there a way to reference hyperlink as an image? For instance if I want to call an action to send email with an email icon or image?
Hello Andy.
I am not quite sure what you are getting at. But if you are speaking about referencing an image in NetSuite from outside NetSuite, you will need to have the “Available without Login” switch on so that others can see the image. Then you can create a visual of the image and wrap that in an anchor “
” tag. It’s typical HTML practice.
Marty
Hi Marty,
I have a custom field on my customer record which has an external URL to the salesforce account – is there a way I can use Forumla(Text) to have the work ‘Link’ on the results, which takes them to that URL?
Thanks!
Hello David,
Yes, you can create a custom field of type formula and then have that field use the “Default Value” setting to create the same type of search and results criteria as described in the article. Then the link will be ready to go on forms and other use case scenarios.
Marty
Hey Marty, Just wondering if it possible to give a customer a link to their own URL for their transaction within an email.
Example, I have added a button to the email template which says “Click here to view your quote” which would take them to their PDF version of the quote.
Let me know if there is a way for this to be done and accessed without logging into the customer portal. (as we are not using this feature currently).
There are two ways to generate NetSuite quotes and other documents for customers that are not licensed uses. See this article if you are using NetSuite’s standard Advanced PDF print engine:
https://blog.prolecto.com/2020/03/21/elevate-netsuite-print-permissions-with-a-custom-suitelet/
We also do this kind of thing all the time with our Content Renderer Engine because we push the boundaries of what most think can be done with NetSuite tools.
Marty
Do you know if there is a Preference or global setting or individual saved search setting that allows this to work. I’ve tried and it won’t work. When I copy in YOUR example in the article, it works – it generates a working link. (The link goes to a page that says the record does not exist, which is fine, of course.)
However, I’ve tried dozens of times, making adjustments to the URL in MY SYSTEM, where I’m ADMIN, and it always gives an error in the column in the results instead of a link: “ERROR: Invalid Expression”
My link (with the leader URL numbers changed for privacy):
‘link’
Hello Tom,
I am confused. If you have it working with the code I supplied, then why are you having trouble? Perhaps try to craft your URL very slowly as I suspect it has something to do with a syntax problem.
Marty
Thank you for your response. Perhaps I was unclear in my description. I have worked quite slowly and spent hours in total. I have successfully used the technique for all kinds of URLs including things like https://www.google.com. So I gained confidence that my syntax is correct. I can now see in my original post that the comment system here converted the actual code I copied into the comment to ‘link’, which is dead. I figure that must be a security feature of the comment board? I wonder if I chop up the link with some intentional spaces if the comment system would allow me to share it?
Hi Tom, if you can send a link to a screenshot, that would help. Or, contact me at https://www.prolecto.com/contact-us/ so that we can set up a separate conversation so I can see better see the details.
Marty
Hello marty, is it still work now? because i try this , but it show the exact formula with anchor tag
Hello Famau,
I have heard that NetSuite may shut down the ability to have HTML come out of saved searches. I sent notes to the NetSuite Product team urging them to reconsider this so-called enhancement. Is this a relatively new NetSuite account you are working on?
Marty
Hi Marty,
I’m trying to add this Default Value in Inline HTML field with Formula: TRUE but I get an error saying this formula has an error. I’m trying to pass the lineUniqueId param to the suitelet URL and open it in a dialog box. i tried various syntax with single quote around the lineuniqiekey but it still has error. Is this even possible to do? the following is the default value i’m trying to set.
Roll Record
Hello Dhruval,
I recommend adding syntax elements slowly to build up complexity to confirm you are getting this to work. Also, make sure you have the global switch ON to allow HTML in Formula Saved Searches in Setup, Company, General Preferences.
Marty
Marty
Marty:
Now that NS has added the account number to the URL, it’s better to make the URL be a relative URL and then the browser prepends the correct account number in front of the “/app”
‘/app/common/entity/custjob.nl?id=’
Also, if you leave what you have “system.netsuite.com” that still works and NS server will resolve that to the correct account number, BUT it’s 1 extra post, wait, response, so it’s slower. The relative URL saves that extra post and return so it’s faster.
Nick,
Thank you. It totally makes sense to use relative URLs when you know that your saved searches are going to be consumed while logged into NetSuite. Yet, if you distribute the results of that search externally, then an absolute URL will be needed.
Marty
Hi Marty,
The latest update now outputs this as text, any ideas how to get it back to a working link?
Thank you Scott. I added an addendum to the article.
Marty
Hi Marty, So I use this technique for billing sales orders. We do our fulfill and bill process at the same time, so I created a SO saved search that has links to Fulfill and Bill. These links work fine, but when i click save and the browser refreshes, it reverts to the saved search instead of the completed transaction record. Do you know if there’s any way to change this behavior?
Here’s examples of the hyperlink code for reference. Maybe it can also help someone else.
Formula (HTML)
‘Fulfill‘
‘Bill‘
Evan,
I suspect I would need a short video to understand the situation better.
Might it be because these links are doing a transform and once you click them, and then you work to commit the record, the underlying transform on a second visit would no long work? Perhaps you have some formulas to dynamically check if those links should show based on the quantity shipped/billed compared to ordered.
Marty
Hi Marty, just wanted to mention an update to your addendum about enabling Formula(HTML) fields. Netsuite has moved where this feature is enabled to Setup –> Company –> Enable Features –> Analytics –> Saved Search. They’ve also added some role based permissions to control who can add HTML formula fields.
Docs are at https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_0403035152.html
Thanks for a great article!
Adam
Thank you Adam for the clarification and reference.
Marty