Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
New Member
Posts: 20
Registered: ‎08-23-2010
Accepted Solution

SData Schema - Field Length

I'm using the SDataCSharpClientLib (SageScottsdalePlatform) C# client library to access SData.


I discovered something somewhat weird with the SDataSchema object.. For a Saleslogix schema object, it returns the field size as only half of what it actually is.


So if a property “AccountName” has a database length of 128, the SMEProperty.AverageLength property only returns 64.


Should I be looking at a different property to retrieve field length?



Posts: 27
Registered: ‎08-06-2009

Re: SData Schema - Field Length

From section 4.7 of the SData spec, the AverageLength property "is a hint for the user interface. A service consumer can use it to set the visible size of edit fields in a form". In the SLX implementation this is populated with half the maximum possible length.


To get the true maximum length of a string property, you'll need to cast the SMEProperty instance into an SMEStringProperty which has a MaximumLength property.

New Member
Posts: 20
Registered: ‎08-23-2010

Re: SData Schema - Field Length

That worked perfectly, thanks Nathan!