Hello, I've been working on several modules for Su...
# suitecommerce
m
Hello, I've been working on several modules for SuiteCommerce over the last few months and ran into an issue with updating a few different records. I am getting a few rather long errors in the browser console but I'm not sure where the issue is. Would anyone be willing to look at these errors and point me in the right direction?
s
Rather than asking, most people just post the error messages here and others will offer advice if they know the answer. So I'd probably just do that.
m
Thanks Steve, wasn't sure the proper way to go about it here's the three errors:
Copy code
PUT <https://dev.360subscriptionstack.com/scs_ss2/extensions/ThreeSixZeroCloudApps/ContractsExtensionPOC3/1.0.5/Modules/Contracts/SuiteScript2/ContractsExtensionPOC3.Contracts.Service.ss?internalid=1&c=TSTDRV2609467&n=3> 500
Copy code
Impossible to parse backend error - Request {"url":"<https://dev.360subscriptionstack.com/scs_ss2/extensions/ThreeSixZeroCloudApps/ContractsExtensionPOC3/1.0.5/Modules/Contracts/SuiteScript2/ContractsExtensionPOC3.Contracts.Service.ss?internalid=1&c=TSTDRV2609467&n=3>","type":"PUT","isLocal":false,"global":true,"processData":false,"async":true,"contentType":"application/json","accepts":{"*":"*/*","text":"text/plain","html":"text/html","xml":"application/xml, text/xml","json":"application/json, text/javascript","script":"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},"contents":{"xml":{},"html":{},"json":{},"script":{}},"responseFields":{"xml":"responseXML","text":"responseText","json":"responseJSON"},"converters":{"text html":true},"flatOptions":{"url":true,"context":true},"jsonp":"callback","cache":false,"dataType":"json","data":"{\"internalid\":\"1\",\"nextbilldate\":\"10/11/2022\",\"lastusagebilldate\":\"\",\"billdaysinadvance\":\"\",\"paymentmethod\":\"3\",\"emailtransactions\":false,\"cancellationDate\":\"02/01/2023\",\"billDaysInAdvance\":\"\"}","validate":true,"parse":true,"wait":true,"emulateHTTP":false,"emulateJSON":false,"dataTypes":["text","json"],"crossDomain":false,"hasContent":true}
Copy code
Impossible to parse backend error - Response <!DOCTYPE html>
<html>

<head>
<title>Notice (SuiteScript)</title>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />

    	<script type='text/javascript' src='/javascript/FieldLevelHelp.jsp?JSP_VER=1&NS_VER=2022.2&minver=15&locale=en_US&buildver=30761'></script>
    	<script type='text/javascript' src='/assets/help_service/3663278969.js?NS_VER=2022.2&minver=15'></script>
    	<script type='text/javascript' src='/ui/jquery/jquery-3.5.1.min.js?NS_VER=2022.2&minver=15'></script>
    	<script type='text/javascript' src='/ui/jquery/jquery_isolation.js?NS_VER=2022.2&minver=15'></script>
    	<script type='text/javascript' src='/javascript/NLUtil.jsp?JSP_VER=1&NS_VER=2022.2&minver=15&locale=en_US&buildver=30761'></script>
    	<script type='text/javascript' src='/javascript/NLUtil.js?NS_VER=2022.2&minver=15&buildver=30761'></script>
    	<script type='text/javascript' src='/javascript/NLUIWidgets.jsp?JSP_VER=1&NS_VER=2022.2&minver=15&locale=en_US&buildver=30761'></script>
    	<script type='text/javascript' src='/assets/legacy_widgets/2249544138.js?NS_VER=2022.2&minver=15'></script>
    	<script type='text/javascript' src='/assets/help_center_service/3696101135.js?NS_VER=2022.2&minver=15'></script>
    	<script type='text/javascript' src='/assets/legacy_apputil/3709065897.js?NS_VER=2022.2&minver=15'></script>
    	<script type='text/javascript' src='/javascript/NLAppUtil.jsp?JSP_VER=1&NS_VER=2022.2&minver=15&locale=en_US&buildver=30761'></script>
    	<script type='text/javascript' src='/uirefresh/script/global.js__NS_VER=2022.2&minver=15&locale=en_US.nlqs?NS_VER=2022.2&minver=15&buildver=30761'></script>
<link rel='stylesheet' href='/core/styles/pagestyles.nl?ct=-5&bglt=FFFFFF&bgmd=E0E6EF&bgdk=808080&bgon=24385B&bgoff=607799&bgbar=24385B&tasktitletext=FFFFFF&crumbtext=6F84A5&headertext=B4BBC7&ontab=FFFFFF&offtab=000000&text=000000&link=000000&bgbody=FFFFFF&bghead=FFFFFF&portlet=607998&portletlabel=FFFFFF&bgbutton=3B89D8&bgrequiredfld=FFFFE5&font=null&size_site_content=9pt&size_site_title=9pt&size=1.0&nlinputstyles=T&accessibility=F&appOnly=F&NS_VER=2022.2'><link rel='stylesheet' type='text/css' href='/uirefresh/css/button.css' />
</head>

<body bgcolor='#FFFFFF' link='#000000' vlink='#000000' alink='#330099' text='#000000' topmargin='0' marginheight='1' onload='page_init()' class='error-page'>
<img class='uir-logo' src='/images/logos/netsuite-oracle.svg' border=0 style='margin-right:30px;margin-left:10px;'>
<table border=0 cellPadding=0 cellSpacing=0 width=100%>

<tr><td class='bglt'>
<table border='0' cellspacing='0' cellpadding='5' width='100%'>
<tr><td class='textboldnolink'>Notice (SuiteScript)</td></tr>
<tr><td vAlign='top'>
<table border='0' cellspacing='0' cellpadding='0' width='100%'>
<tr><td class='text'>&nbsp;</td></tr>

<tr><td class=text><img src='/images/5square.gif' width=5 height=5>{"type":"error.SuiteScriptError","name":"INVALID_FLD_VALUE","message":"Invalid date value (must be M/D/YYYY)","stack":["anonymous(N/serverRecordService)","<anonymous>(/Web Site Hosting Files/Live Hosting Files/SSP Applications/NetSuite Inc. - SCS/SuiteCommerce Standard2/extensions/ThreeSixZeroCloudApps/ContractsExtensionPOC3/1.0.5/Modules/Contracts/SuiteScript2/ContractsExtensionPOC3.Contracts.Model.js:217)","service(/Web Site Hosting Files/Live Hosting Files/SSP Applications/NetSuite Inc. - SCS/SuiteCommerce Standard2/extensions/ThreeSixZeroCloudApps/ContractsExtensionPOC3/1.0.5/Modules/Contracts/SuiteScript2/ContractsExtensionPOC3.Contracts.Service.ss:27)","anonymous(N/serverRecordService)"],"cause":{"type":"internal error","code":"INVALID_FLD_VALUE","details":"Invalid date value (must be M/D/YYYY)","userEvent":null,"stackTrace":["anonymous(N/serverRecordService)","<anonymous>(/Web Site Hosting Files/Live Hosting Files/SSP Applications/NetSuite Inc. - SCS/SuiteCommerce Standard2/extensions/ThreeSixZeroCloudApps/ContractsExtensionPOC3/1.0.5/Modules/Contracts/SuiteScript2/ContractsExtensionPOC3.Contracts.Model.js:217)","service(/Web Site Hosting Files/Live Hosting Files/SSP Applications/NetSuite Inc. - SCS/SuiteCommerce Standard2/extensions/ThreeSixZeroCloudApps/ContractsExtensionPOC3/1.0.5/Modules/Contracts/SuiteScript2/ContractsExtensionPOC3.Contracts.Service.ss:27)","anonymous(N/serverRecordService)"],"notifyOff":false},"id":"","notifyOff":false,"userFacing":false}</td></tr>

<tr><td class='text'>&nbsp;</td></tr>
<tr><td class='text'>&nbsp;</td></tr>
</table></td></tr></table></td></tr>
<tr>        <td>

    

    <table  id='tbl_goback' cellpadding='0' cellspacing='0' border='0' class='uir-button'
          style='margin-right:6px;cursor:hand;' role='presentation'>

        <tr id='tr_goback' class='pgBntG pgBntB'>
        <td id='tdleftcap_goback'><img src='/images/nav/ns_x.gif' class='bntLT' border='0' height='50%' width='3' alt=''/>
            <img src='/images/nav/ns_x.gif' class='bntLB' border='0' height='50%' width='3' alt=''/>
        </td>
        <td id='tdbody_goback' height='20' valign='top' nowrap class='bntBgB'>


    <input type='button' style='' class='rndbuttoninpt bntBgT'

        value='Go Back'

    id='goback' name='goback'

    

    

     onclick="history.back(); return false;"

	    onmousedown="this.setAttribute('_mousedown','T'); setButtonDown(true, false, this);"
	    onmouseup="this.setAttribute('_mousedown','F'); setButtonDown(false, false, this);"
	    onmouseout="if(this.getAttribute('_mousedown')=='T') setButtonDown(false, false, this);"
	    onmouseover="if(this.getAttribute('_mousedown')=='T') setButtonDown(true, false, this);"
    ></td> 

       <td id='tdrightcap_goback'>
           <img src='/images/nav/ns_x.gif' height='50%' class='bntRT' border='0' width='3' alt=''>
           <img src='/images/nav/ns_x.gif' height='50%' class='bntRB' border='0' width='3' alt=''>
       </td>
		</tr>

    </table>
    </td>
</tr>
</table>

<script language='JavaScript' type='text/javascript'>
function page_init() {
}
</script>

</body>
</html>
s
This bit seems to be problematic, no?
Copy code
<tr><td class=text><img src='/images/5square.gif' width=5 height=5>{"type":"error.SuiteScriptError","name":"INVALID_FLD_VALUE","message":"Invalid date value (must be M/D/YYYY)","stack":["anonymous(N/serverRecordService)","<anonymous>(/Web Site Hosting Files/Live Hosting Files/SSP Applications/NetSuite Inc. - SCS/SuiteCommerce Standard2/extensions/ThreeSixZeroCloudApps/ContractsExtensionPOC3/1.0.5/Modules/Contracts/SuiteScript2/ContractsExtensionPOC3.Contracts.Model.js:217)","service(/Web Site Hosting Files/Live Hosting Files/SSP Applications/NetSuite Inc. - SCS/SuiteCommerce Standard2/extensions/ThreeSixZeroCloudApps/ContractsExtensionPOC3/1.0.5/Modules/Contracts/SuiteScript2/ContractsExtensionPOC3.Contracts.Service.ss:27)","anonymous(N/serverRecordService)"],"cause":{"type":"internal error","code":"INVALID_FLD_VALUE","details":"Invalid date value (must be M/D/YYYY)","userEvent":null,"stackTrace":["anonymous(N/serverRecordService)","<anonymous>(/Web Site Hosting Files/Live Hosting Files/SSP Applications/NetSuite Inc. - SCS/SuiteCommerce Standard2/extensions/ThreeSixZeroCloudApps/ContractsExtensionPOC3/1.0.5/Modules/Contracts/SuiteScript2/ContractsExtensionPOC3.Contracts.Model.js:217)","service(/Web Site Hosting Files/Live Hosting Files/SSP Applications/NetSuite Inc. - SCS/SuiteCommerce Standard2/extensions/ThreeSixZeroCloudApps/ContractsExtensionPOC3/1.0.5/Modules/Contracts/SuiteScript2/ContractsExtensionPOC3.Contracts.Service.ss:27)","anonymous(N/serverRecordService)"],"notifyOff":false},"id":"","notifyOff":false,"userFacing":false}</td></tr>
Setting dates in NetSuite via scripting can be tricky, so it looks like you’re not getting it right
m
Yea, that was the part that looked off too me. It looked like it was throwing that error even if I'm not updating a date field but let me triple check the code
So I removed the fields that were date related from the update screen and I'm still getting that specific error when I'm attempting to update
Found the issue. It was a single date field that I didn't have converted in the
put
function. I didn't suspect it because it was showing the in the table fine on the page. The record just wasn't updating
s
OK, good, glad it worked out
m
Thanks for the nudge in the right direction. Sometimes the answer is right in front of my face
netsuite halo 1
s