skip to Main Content

I am currently creating approval buttons in NetSuite in a saved search so that records can be approved pressing the button directly in the saved search.

The difficult part of getting the button to actually work and trigger the workflow is working, however we are trying to create a user friendly button. The field is a formula (HTML) field.

The styling of the button is as below:
a href=XXXX button type="button" a style="background-color: #04AA6D; border-radius: 4px; color: white; border: none; padding: 4px 12px; font-weight: bold"Reject/button/a

We now want to add a button:hover feature to the button which does not seem to be possible, we have tried a bunch of different things but nothing works. Any advice?

2

Answers


  1. TLDR; You can’t.

    Just because you can do something doesn’t mean that you should. The only way to produce a :hover effect is either via stylesheet or with client side JavaScript and both of those options are unavailable within a saved search.

    I understand the desire to make your saved search fancy, but the likelihood that something breaks when NetSuite makes an update is high. Saved Searches are intended to present data, not be a replacement for an application.

    Login or Signup to reply.
  2. You can use onxxx handlers as attributes within your <a> tags and have the inline JavaScript update styling. An example:

    '<a onmouseover="this.style.backgroundColor=''#04666D'';" onmouseout="this.style.backgroundColor=''#04AA6D'';" style="background-color: #04AA6D; border-radius: 4px; color: white; border: none; padding: 4px 12px; font-weight: bold;" href="" >Reject</a>'
    

    In this example it’s the onmouseover and onmouseout attributes doing the work. Note that the single quotes around the color hex codes are doubled up to satisfy SQL escaping requirements.

    I wouldn’t necessarily recommend this within a saved search, but what’s the worst that can happen? Probably that NetSuite make changes which prevent the JavaScript running, and then the hover behavior stops working.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search