Which Summer ’19 (v46) sObject types are returning field describe results of soapType “tns:json”?

This might seem like an oddly specific question, but hear me out.

I have an application that I distribute freely to whoever wants to use it that talks to Salesforce via the Partner API. Right now the current release is using the Spring ’19 WSDL (v45.0) and the corresponding API endpoints.

That works great, but now the Summer ’19 (v46.0) release is hitting sandboxes and very soon production orgs as well. I’m starting to get error reports from people using my tool against Summer ’19 sandboxes.

The following error is coming back from a describeSObjects() Partner API v45.0 call.

System.InvalidOperationException: Instance validation error: ‘tns:json’ is not a valid value for soapType.

It was recommended that I check the v46.0 Partner API WSDL. Sure enough, it now has json as a fieldType and a soapType of tns:json.

So it would appear that a field type defined in v46.0 is leaking back into a v45.0 API call. That’s a bit of a problem as it potentially breaks any pre-Summer `19 integration that makes a describe sObject call on the corresponding type(s).

I’m going to raise a support case for this, but I don’t know under what circumstances the new tns:json field type is coming back. The first question Salesforce support is going to ask is how to reproduce the error. It isn’t in any of the sandboxes I have access to.

So my question is:
Which sObject type(s) are returning a field with the soapType tns:json?

Raised as case 23206206


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Apparently, there is a bug on Salesforce API v45.0 which leaks the new type JSON designed for Salesforce API v46.0. This is observed on the APIEvent object on the RecordData field whose type is json. Here is a plug from the documentation:


json Properties
Nillable Description
A JSON string that represents the queried objects’ metadata. This metadata includes the number of results of a query per entity type and
the entity IDs. Example

{ "totalSize" : 1,
  "done" : true,
  "records" : [ {
    "attributes" : {
      "type" : "Account"
    "Id" : "001xx000003DMvCAAW",
    "Contacts" : {
      "totalSize" : 3,
      "done" : true,
      "records" : [ {
        "attributes" : {
          "type" : "Contact"
        "Id" : "003xx000004U7xKAAS"
      }, {
        "attributes" : {
          "type" : "Contact"
        "Id" : "003xx000004U7xLAAS"
      }, {
        "attributes" : {
          "type" : "Contact"
        "Id" : "003xx000004U7xMAAS"
      } ]
  } ]

This is already reported to Salesforce and they have worked on it. Currently, the support did suggest to disable the beta which wasn’t what we expected though.

Known Issue: DescribeSObject call using the v45.0 Partner API are failing due to a complex type(json) that isn’t defined in the WSDL

Method 2

Since ApiEvent (introduce in 36) and ApiEventStream (introduce in 41) are no longer for only customers with Real-Time Event Monitoring, preview org using with the API 46 available can have access to the definition of both objects. Meaning: if we describe the Salesforce Org using the REST or SOAP api v45 , we will have access to those objects.

Those objects use the field ‘RecordData’ of type ‘json’.

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x