Nibbo
Posts: 7
Joined: Fri Jun 09, 2017 5:31 pm

UpdateJobCustomField usage

Tue Jun 13, 2017 11:16 am

Can anyone advise as to how to update the job custom fields via SOAP?
I have added a couple of custom fields via the Dispatch window and they show up just fine in that there is now a placeholder for the window and they can be added to the report/list, so far so good.

I can set them via the web browser but when I try to run the following code (VB.NET)...

Code: Select all

'	create the job on GpaGate
iJobNumber = gpsgateDispatchService.CreateJob(sSessionId, 5, oReader("GeoCodeLat"), oReader("GeoCodeLong"), "Invoice:" & oReader("InvNo") & " - " & oReader("Account"), Now())
'	add the pallet count
gpsgateDispatchService.UpdateJobCustomField(sSessionId, 5, iJobNumber, 1, oReader("Counter").ToString)
The first line is works fine and returns an integer in the variable iJobNumber.
The second line fails with {"Server was unable to process request. ---> Object reference not set to an instance of an object."}
All values are set correctly and the integer for the CustomFieldNumber matches what I see in the customisation database table.

Has anyone else used this feature and got it to work?

Thanks

Nibbo
Posts: 7
Joined: Fri Jun 09, 2017 5:31 pm

Re: UpdateJobCustomField usage

Tue Jun 13, 2017 1:01 pm

I actually meant via the webservice.
I did try SOAP too and got the same result...

POST data

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <UpdateJobCustomField xmlns="http://gpsgate.com/services/">
      <sessionId>E63843D380452B2960C8B235A13FDD76</sessionId>
      <appId>5</appId>
      <jobId>30</jobId>
      <customfieldValueId>1</customfieldValueId>
      <customFieldNewValue>5</customFieldNewValue>
    </UpdateJobCustomField>
  </soap:Body>
</soap:Envelope>
Result:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Server was unable to process request. ---> Object reference not set to an instance of an object.</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>

Return to “GpsGate for Developers”