Add ‘Remove’ Link on Native Sublist
Hi, you know how you can a ‘Remove’ link for child sublists when it’s a custom record? The link removes the parent/child relationship.
Is there a way to do this for native records? For example, can I add a remove link for a phone call sublist on a customer record so I can quickly disassociate the phone calls?
The only way I know to do this is by adding some Javascript to the form to manage the DOM. This is not supported by NetSuite, but it does not seem to cause problems.
So you could try something like this: Add a script to the record/form. On the page init, the coding would look like the below (you will need to find the name of your record machine and adjust accordingly). This example would remove the Remove link on the Files subtab:
var html = document.getElementById('mediaitem_div');
if(html != null) html.innerHTML = html.innerHTML.replace(/>Remove</g, /></);
Ok, thanks!
Sorry, I now noticed I read this the wrong way. You trying to add a remove link, not remove it.
What you can do here is play with HTML and JavaScript and build the logic into a sublist (using a saved search). This would be under a text formula column. The formula will vary depending on the record you are trying to disconnect, but surely will by using the nlapiSubmitField() API.
Not natively, you’re basically stuck with scripting if you want a true “disassociate” action on native activity sublists. I’ve done this with a custom sublist (saved search) and a Suitelet/UE that clears the company field on the phone call, and it worked but it’s a bit of maintenance. Also, totally unrelated but the last time I embedded raw links in a formula field I got random junk injected in the HTML, including https://playmegafishing.com/, https://playcrazytime.org/, https://7up7downgame.com/ and it was a pain to clean up. I’d avoid DOM hacks if you can and keep it server-side for stability.



