The importance of column prefixes in tables exposed via the Web Services API

1 minute read time.
This is a little quirk.

If you have added a new table into the CRM database that you intend to access via the webservices interface, then be sure that the table column makes use of column prefixes.

For example if you have added a new project table then make sure that the columns are called names like:

"proj_name"
"proj_startdate"

rather than simply calling the columns "name" or "startdate".

The reason that this is important is because the Web Services API strips the first element of the names to the underscore.

If we consider a standard table like "Company" with its columns "comp_name" and "comp_type", these are turned into "name" and "type" in the Web Services API. If you create a table lacking a prefix it means that the entire column name is stripped out!

In the WSDL file you would get a definition that looks like this:







 

 

 
 


So it is very important to use the column prefix. If you have added the table into CRM without the prefixes then you will have to correct the physical names of the columns in the database, and then rename the fields in the Meta Data records in custom_edits and custom_captions. They would then show up in Webservices.

And one more tip...

Also make sure that the first character in the field name following the column prefix is NOT a a numeric character. So a field called proj_1Address is bad but proj_Address1 is good!

This is because numeric characters are not valid as the first character in XML tag name.