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.
Pricing script won't do it's thing
Hello
I've written a script to auto-populate 4 different price levels based on a figure entered into a custom field. It triggers on field changed. It triggers correctly. The values populate themselves and all is good... until you save the record. It won't save the new pricing values. In fact, it won't save any values entered into the pricing fields manually either.
Anyone care to comment?
function field_change(type,name) { var baseprice = (nlapiGetFieldValue('custitemsellpricegst') / 1.1); var corpten = ((nlapiGetFieldValue('custitemsellpricegst') - 0.833333) / 1.1); var corpfive = ((nlapiGetFieldValue('custitemsellpricegst') - 0.416667) / 1.1); var bprice = Math.round(baseprice*10000)/10000; var tenprice = Math.round(corpten*10000)/10000; var fiveprice = Math.round(corpfive*10000)/10000; if (name == 'custitemsellpricegst') { document.getElementById("price_price_1_1_fs").value = bprice; document.getElementById("price_price_1_2_fs").value = tenprice; document.getElementById("price_price_1_3_fs").value = fiveprice; document.getElementById("price_price_1_7_fs").value = bprice; } } 0