Posts Tagged ‘invalid_field’

INVALID_FIELD: No such column ‘type’ error in flex salesforce communication

October 29, 2010

While trying to pass a custom object in salesforce from Flex. If you encounter the below error. Especially if you are passing a wrapper class to the webservice method.

“INVALID_FIELD: No such column ‘type’ on entity . If you are attempting to use a custom field, be sure to append the ‘__c’ after the custom field name. Please reference your WSDL or the describe call for the appropriate names.”

This occurs because the flex salesforce toolkit forces a property type while creating request parameters to be serialized with salesforce.

There are 2 solutions to this: First the not so attractive one is to convert everything to wrapper classes and send all data as SObjects. This will add overhead on salesforce  side to manage the conversion of object.

Second, go to Salesforce flex toolkit and add a condition to the SObject class on line 101:

if(this["type"]){
this.writeValue(sobjectNs, writer, "type", this["type"]);
}

This should solve the issues of not being able to send the data to salesforce.


%d bloggers like this: