• DeVerl Stokes
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I am using the rest API to create a new case. Nearly everything is working correctly, except that new cases are always created with Closed (IsClosed) set to true (1).

If I try to set Closed, I get INVALID_FIELD:

"body": "[{\"message\":\"No such column 'Closed' on sobject of type Case\",\"errorCode\":\"INVALID_FIELD\"}]"

If I try to set IsClosed, I get INVALID_FIELD_FOR_INSERT_UPDATE:

 "body": "[{\"message\":\"Unable to create\/update fields: IsClosed. Please check the security settings of this field and verify that it is read\/write for your profile or permission set.\",\"errorCode\":\"INVALID_FIELD_FOR_INSERT_UPDATE\",\"fields\":[\"IsClosed\"]}]"



If I do a describe on the Case object, the result includes this (IsClosed):

[18] => Array
                        (
                            [aggregatable] => 
                            [autoNumber] => 
                            [byteLength] => 0
                            [calculated] => 
                            [calculatedFormula] => 
                            [cascadeDelete] => 
                            [caseSensitive] => 
                            [controllerName] => 
                            [createable] => 
                            [custom] => 
                            [defaultValue] => 
                            [defaultValueFormula] => 
                            [defaultedOnCreate] => 1
                            [dependentPicklist] => 
                            [deprecatedAndHidden] => 
                            [digits] => 0
                            [displayLocationInDecimal] => 
                            [encrypted] => 
                            [externalId] => 
                            [extraTypeInfo] => 
                            [filterable] => 1
                            [filteredLookupInfo] => 
                            [groupable] => 1
                            [highScaleNumber] => 
                            [htmlFormatted] => 
                            [idLookup] => 
                            [inlineHelpText] => 
                            [label] => Closed
                            [length] => 0
                            [mask] => 
                            [maskType] => 
                            [name] => IsClosed
                            [nameField] => 
                            [namePointing] => 
                            [nillable] => 
                            [permissionable] => 
                            [picklistValues] => Array
                                (
                                )

                            [precision] => 0
                            [queryByDistance] => 
                            [referenceTargetField] => 
                            [referenceTo] => Array
                                (
                                )

                            [relationshipName] => 
                            [relationshipOrder] => 
                            [restrictedDelete] => 
                            [restrictedPicklist] => 
                            [scale] => 0
                            [soapType] => xsd:boolean
                            [sortable] => 1
                            [type] => boolean
                            [unique] => 
                            [updateable] => 
                            [writeRequiresMasterRead] => 
                        )


Further, if I go to the web interface and try change the value of the Status field from Closed to New, it shows up as changed (red text), but reverts when I press the Save button.

Any tips on how to create a new case, using the rest API, with a status of "New" and without setting Closed (or IsClosed)?
I am using the rest API to create a new case. Nearly everything is working correctly, except that new cases are always created with Closed (IsClosed) set to true (1).

If I try to set Closed, I get INVALID_FIELD:

"body": "[{\"message\":\"No such column 'Closed' on sobject of type Case\",\"errorCode\":\"INVALID_FIELD\"}]"

If I try to set IsClosed, I get INVALID_FIELD_FOR_INSERT_UPDATE:

 "body": "[{\"message\":\"Unable to create\/update fields: IsClosed. Please check the security settings of this field and verify that it is read\/write for your profile or permission set.\",\"errorCode\":\"INVALID_FIELD_FOR_INSERT_UPDATE\",\"fields\":[\"IsClosed\"]}]"



If I do a describe on the Case object, the result includes this (IsClosed):

[18] => Array
                        (
                            [aggregatable] => 
                            [autoNumber] => 
                            [byteLength] => 0
                            [calculated] => 
                            [calculatedFormula] => 
                            [cascadeDelete] => 
                            [caseSensitive] => 
                            [controllerName] => 
                            [createable] => 
                            [custom] => 
                            [defaultValue] => 
                            [defaultValueFormula] => 
                            [defaultedOnCreate] => 1
                            [dependentPicklist] => 
                            [deprecatedAndHidden] => 
                            [digits] => 0
                            [displayLocationInDecimal] => 
                            [encrypted] => 
                            [externalId] => 
                            [extraTypeInfo] => 
                            [filterable] => 1
                            [filteredLookupInfo] => 
                            [groupable] => 1
                            [highScaleNumber] => 
                            [htmlFormatted] => 
                            [idLookup] => 
                            [inlineHelpText] => 
                            [label] => Closed
                            [length] => 0
                            [mask] => 
                            [maskType] => 
                            [name] => IsClosed
                            [nameField] => 
                            [namePointing] => 
                            [nillable] => 
                            [permissionable] => 
                            [picklistValues] => Array
                                (
                                )

                            [precision] => 0
                            [queryByDistance] => 
                            [referenceTargetField] => 
                            [referenceTo] => Array
                                (
                                )

                            [relationshipName] => 
                            [relationshipOrder] => 
                            [restrictedDelete] => 
                            [restrictedPicklist] => 
                            [scale] => 0
                            [soapType] => xsd:boolean
                            [sortable] => 1
                            [type] => boolean
                            [unique] => 
                            [updateable] => 
                            [writeRequiresMasterRead] => 
                        )


Further, if I go to the web interface and try change the value of the Status field from Closed to New, it shows up as changed (red text), but reverts when I press the Save button.

Any tips on how to create a new case, using the rest API, with a status of "New" and without setting Closed (or IsClosed)?