Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, June 20, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Is there any documentation or examples of FormatString property by FormatType and or data type?
Lawrence Reid
Posts: 63
 
Is there any documentation or examples of FormatString property by FormatType and or data type?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Aug 07 8:14 AM
This does not seem to follow the VBScript examples I have. I am specifically having a problem with the FormatString for the FormatType ftInteger. Some users are trying to put in alpha characters in the field. When this is done the field displays the character when in the field and 0 when not in the field. When they leave the tab they get a data type error and it erases all of the other data the entered on the tab.

In contrast, I found a successful FormatString for the FormatType of ftPercent as %.3f%%. This behaves as expected. Even if a user enters text into the field, it is ignored and displays and stores 0.000% and this does not cause the error or the loss of data as in my integer example. Any help is greatly appreciated.
[Reply][Quote]
Jeff Crawford
Posts: 52
 
Re: Is there any documentation or examples of FormatString property by FormatType and or data type?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Aug 07 12:52 PM
You could use the OnChange event to do something like this...

If Not IsNumeric(Sender.Text) Then Sender.Text = 0

which would prevent users from entering none numeric characters.

[Reply][Quote]
Lawrence Reid
Posts: 63
 
Re: Is there any documentation or examples of FormatString property by FormatType and or data type?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Aug 07 1:03 PM
Jeff thanks for the info. I also found some scripts in System:SLX_Common to check for valid numers. These will work for now, and I plan to use them to fix this today, but there should be a simple FormatString that will only allow numbers like the one for percents. Please le me know if you come up with any other ideas.

Function SLXIsNumeric(Value)
SLXIsNumeric = IsNumeric(Value) or (vartype(value) = vbdecimal)
End Function

'and

Function ValidateIntegerEntry(Key)
If ((Key < 48) Or (Key > 57)) And Not (Key = 8) And Not (Key = 46) And Not (Key = 44) Then
ValidateIntegerEntry = 0
Else
ValidateIntegerEntry = Key
End If
End Function
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Is there any documentation or examples of FormatString property by FormatType and or data type?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Aug 07 2:57 PM
And to answer your question about documentation for the Format Strings, it can be found on the SalesLogix client help file.

Search for "Format Strings" and you will find the the valid format strings for each data type.
[Reply][Quote]
Lawrence Reid
Posts: 63
 
Re: Is there any documentation or examples of FormatString property by FormatType and or data type?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Aug 07 3:55 PM
I found this in the help file. I tried %d0 and %x0 but niether prevented alpha charcters like the %.3f%% does for the FormatType ftPercent. Do you have any examples for of FormatStrings for the ftInteger FormatType? The option "d" below does make sence to me since integers do not support decimals. I also do not understand the hexadecimal option x.

The table below lists the format string options for integer fields. Valid string formats depend on the format type you select.

A format string must begin with a % sign and end with a format type character:

[%] [type]

Option
Description

d Decimal. The value must be an integer. The value is displayed as a decimal.

x Hexadecimal. The format of the field must be an integer value. The value is converted to a string of hexadecimal digits. If the format string contains a precision specifier, it indicates the resulting string must contain at least the specified number of digits; if the value has fewer digits, the resulting string is left-padded with zeros.

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/20/2025 6:41:13 AM