Show / Hide Table of Contents

TruncateStringFields

Object and Type

Object  : FCSession

Type     : Property

Prototype

Public TruncateStringFields As Boolean

Description

This property allows you to automatically truncate strings, as you assign them, for all Generics in this session. If it is set to True, FCFL will make sure that any string that you set will be truncated at the maximum length of the string field, as determined from the database. This does mean that you can lose data, as you assume that the full string will go into the database.

If the property is set to False (the default), then FCFL will attempt to write the entire string to the database. This usually will result in an error being thrown, which you can trap.

The best solution, of course, is to limit the length of your strings in your thick client application, or in your web pages.

Example

The following example attempts to write data to a field defined to a maximum length of 10. An error would be thrown.

JavaScript:

FCSession.TruncateStringFields = true;

boCase("x_short_field") = 'abcdefghijklmnopqrstuvwxyz';

The following example does the same thing, but truncates the field at the maximum length (10).

JavaScript:

FCSession.TruncateStringFields = false;

boCase("x_short_field") = 'abcdefghijklmnopqrstuvwxyz';
Back to top © 2022 Dovetail Software, Inc. - All rights reserved.
Clarify, Amdocs, and related products and names are copyright and trademark of Amdocs, Inc.
.NET, Visual Studio.NET, C#, Visual Basic and related products are trademark of Microsoft corporation.