function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Saad Ansari 13Saad Ansari 13 

System.JSONException: No such column


System.JSONException: No such column 'subType' on sobject of type Case

We are getting this error although we use in our rest api:

Case[] cl = (Case[])JSON.deserialize(bodyString, list<Case>.class);

our request is :

[{ 
"description": "tyfgjgfjg kgiuygfiyft kygygiy", 
"suppliedEmail": "test@test.om", 
"type": "test", 
"subType": "subtest", 
"closedByFaq": false, 
"mobileNumber": "", 
"Case_Page_information": "http:\/\/0.0.0.0:8800\/settings\/payment", 
"accountExternalId": "abcd12334"
 }]
 The three standard fields suppliedemail, description and type get mapped fine. Its the custom field it is not able to find. Now on production it works fine - in sandbox we are just introducing a new field Case_Page_information and now none of the custom fields work in sandbox. 
Saad Ansari 13Saad Ansari 13
actual error:

Exception catched:No such column 'subType' on sobject of type Case,
Class.System.JSON.deserialize: line 15, column 1
Class.CaseWS.insertCase: line 47, column 1
GauravGargGauravGarg
Hi Saad,

There are two possibilities:
  • Check your FLS (field level security). 
  • Field API name would append "__c" in the end. 
Please try above two approach and let me know if you still face error. 

Thanks,
Gaurav
skype: gaurav62990