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

by

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.

Advertisements

Tags: , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: