Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
NetSuite has launched SuiteSuccess Wholesale Distribution Edition, in Japan. Please join us the webinar on February 12 that introduces NetSuite solution with demos and case studies for Wholesale Industry.
Register Now
small script for price calculation
i want to calculate the minimum price we can sell an item based on the weight and the tax class. im new to suitescript, but heres what i have:
function AZmin()
{
var weight = nlapiGetFieldValue('weight');
if (weight <= 749)
{
var shipping = 2.87;
}
if (weight >= 750 && weight <=999)
{
var shipping = 3.49;
}
if (weight >= 1000)
{
var shipping = 5.67;
}
var avgcost = nlapiGetFieldValue('averagecost');
var taxcode = nlapiGetFieldValue('salestaxcode');
if (taxcode == "VAT:S")
{
var minprice = ((avgcost + shipping) /0.68);
}
if (taxcode == "VAT:C")
{
var minprice = ((avgcost + shipping) /0.8);
}
if (taxcode == "VAT:Z")
{
var minprice = ((avgcost + shipping) /0.85);
}
nlapiSetFieldValue("custitem_minprice", minprice);
return true;
}
I thought I could apply this to inventory items in the script deployment, but i cant. What would be the best way to implement this?