Forum Discussion
Date types are not parsed properly in custom body fields and thus if you want to use the standard snaps you cannot use null values.
Interesting. Is there a support ticket about that issue?
- jamesv7 years agoNew Contributor II
IIRC I tried to report this as a part of asking for help with a workaround.
I think there was another issue relating to null fields still not being updated properly which is why I also did this. I mean, I asked this over a year ago, lol.
It’s probably worth checking it out as it is definitely still a problem or is at least ticketed - I almost did this workaround again very for a much more complicated series of Netsuite SOAP calls but gave up when I realized I didn’t actually have to change the number of date columns we’re already splitting calls across, and it doesn’t need proper updates as we expect only to create new Netsuite objects using the process.
- ptaylor7 years agoEmployee
James, I just tested this. The error is happening on the NetSuite side. I verified that by sending a request via Postman. Here’s the SOAP request (the body of it):
<SOAP-ENV:Body> <ns0:update> <ns0:record ns2:type="ns1:Job" internalId="481756"> <ns1:customFieldList> <ns4:customField ns4:scriptId="custentity777" ns4:internalId="489" ns2:type="ns4:StringCustomFieldRef"> <ns4:value/> </ns4:customField> <ns4:customField ns4:scriptId="custentity15" ns4:internalId="119" ns2:type="ns4:DateCustomFieldRef"> <ns4:value/> </ns4:customField> </ns1:customFieldList> </ns0:record> </ns0:update> </SOAP-ENV:Body>
and the response:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsd=“XML Schema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
soapenv:Body
soapenv:Fault
soapenv:Server.userException
java.text.ParseException: Invalid dateTime format:
<ns1:hostname xmlns:ns1=“WebServices - Axis”>partners002.prod.svale.netledger.com</ns1:hostname>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>The other custom field is a string. Setting that to null works fine.
- jamesv7 years agoNew Contributor II
Your body statement is invalid as per the SOAP API’s specs. There is a separate region of null fields you have to declare. Your statement should be:
<SOAP-ENV:Body> <ns0:update> <ns0:record ns2:type="ns1:Job" internalId="481756"> <ns1:customFieldList> <ns4:customField ns4:scriptId="custentity777" ns4:internalId="489" ns2:type="ns4:StringCustomFieldRef"> <ns4:value/> </ns4:customField> </ns1:customFieldList> <ns3:nullFieldList ns2:type="ns3:NullField"> <ns3:name>custentity15</ns3:name> </ns3:nullFieldList> </ns0:record> </ns0:update> </SOAP-ENV:Body>
EDIT: actually, even this is wrong - both of your values should be in the nullFieldList:
<SOAP-ENV:Body> <ns0:update> <ns0:record ns2:type="ns1:Job" internalId="481756"> <ns3:nullFieldList ns2:type="ns3:NullField"> <ns3:name>custentity15</ns3:name> <ns3:name>custentity777</ns3:name> </ns3:nullFieldList> </ns0:record> </ns0:update> </SOAP-ENV:Body>