I'm trying to use suitescript to hide our international shipping methods when a customer is checking out who has United States picked as the shipping country. I have been working on this for two days with no luck.
Here is my code:
function PageInit() { var shipcountry = nlapiGetFieldValue(shipcountry); if (shipcountry == 'United States') { nlapiRemoveSelectOption('shipmethod', 'UPS_Worldwide_Express'); nlapiRemoveSelectOption('shipmethod', 'UPS_Worldwide_Expedited'); nlapiRemoveSelectOption('shipmethod', 'UPS_Ground_to_Canada'); nlapiRemoveSelectOption('shipmethod', 'Air_Mail-over_1_lb'); } if (shipcountry =! 'United States') { nlapiRemoveSelectOption('shipmethod', 'Pick-Up'); nlapiRemoveSelectOption('shipmethod', 'Priority_Mail'); nlapiRemoveSelectOption('shipmethod', 'UPS_2_Day_Air'); nlapiRemoveSelectOption('shipmethod', 'UPS_2_Day_Air-Alaska/HI'); nlapiRemoveSelectOption('shipmethod', 'UPS_3_Day_Select'); nlapiRemoveSelectOption('shipmethod', 'UPS_Ground'); nlapiRemoveSelectOption('shipmethod', 'UPS_Next_Day_Air'); } }And the error I get when trying to view the page:An unexpected error occurred in a script running on this page.
PageInit (pageInit)
customform
JS_EXCEPTION
TypeError fldnam is undefined
Any suggestions would be greatly appreciated.