This documentation is archived and is not being maintained.

String

Dynamics
banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

Displays text on one line. The following properties are available:

String propertiesTypeDescription
{Field}.DataValueA reference to a string objectGet/set property.
{Field}.MaxLengthIntegerGet property.

The maximum length of the string.


Example

The following code example shows how to use a field of type String.

var oField = crmForm.all.SOME_STRING_FIELD_ID;

var sValue = "String that might be too long.";

if (sValue.length > oField.MaxLength)
{
   sValue = sValue.substr(0, oField.MaxLength); 
}

oField.DataValue = sValue;

See Also

Concepts

Other Resources

Tasks


© 2010 Microsoft Corporation. All rights reserved.


Show: