Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.
Passing JavaScript Variables to getCurrentAttribute
I believe that the way I am trying to achieve my desired result is not possible in NetSuite, but I am hoping someone may have found a workaround:
Our client has several custom item fields for swatches. Here is a Javascript snippet I am using to display the swatch (using tags):
swatch = "<%=getCurrentAttribute('item','custitemswatch2')%>"; if (swatch.length > 0) {document.write("<td><a onclick=swapImage('<%=getCurrentAttribute('item','internalid')%>','" + swatch + "')> <img width='80' height='80' src='<%=getCurrentAttribute('item','custitemswatch2')%>' alt='<%=getCurrentAttribute('item','custitemswatch2_alt')%>' title='<%=getCurrentAttribute('item','custitemswatch2_alt')%>'></a></td>"); } document.write("</tr><tr>"); 0