Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, July 5, 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: text field in datagrid throws error when len>100
David Nunnally
Posts: 206
 
text field in datagrid throws error when len>100Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 May 11 2:08 PM
fiogf49gjkf0d

Several years ago I edited the Add Opportunity Product grdProducts to include the product.description field which is a text field. All has worked fine until today. Seems as though when you add a product to the grid and the description is larger than 100 characters it throws an exception. I edited the part and made the description 97 characters and it works - 101 it fails. The column was defined as...


    Set col = grdProducts.Columns.Add(0)
    col.FieldName = "DESCRIPTION"
    col.Caption = Application.Translator.Localize("Description")
    col.Width = 130


And I tried...


    Set col = grdProducts.Columns.Add(14)
    col.FieldName = "DESCRIPTION"
    col.Caption = Application.Translator.Localize("Description")
    col.Width = 130
    col.paintstyle = 2


 


Either way fails with the same "Multiple-step operation gerated erros. check each status value." when I try to assign the value of the text field to the recordset...


    .Fields("DESCRIPTION").Value = objRS.Fields("myDESCRIPTION").Value


 


Any suggestion on how I can store the value of the text field in a grid?


 

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: text field in datagrid throws error when len>100Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 May 11 4:34 AM
fiogf49gjkf0d

How large is the actual column in the database though ? OLEDB will choke if the field is bigger than the underlying column. I know it should be a Memo - but may have been changed?


And, if it's not filled in - this will cause same error so:


 .Fields("DESCRIPTION").Value = CheckForNull(objRS.Fields("myDESCRIPTION").Value)


Fixes that.


 

[Reply][Quote]
David Nunnally
Posts: 206
 
Re: text field in datagrid throws error when len>100Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 May 11 8:32 AM
fiogf49gjkf0d

The field size was 113 characters of the offending part. Everything under 101 characters works. I have 5 parts that have a description from 101 to 158 characters and each throw an exception unless I get them down to 100 characters or less. I have no records in the table with null values in this column.

[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: text field in datagrid throws error when len>100Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 May 11 8:50 AM
fiogf49gjkf0d

Question:


  How did you define the Products Field on the RecordSet that is bound to the Grid?


  Did you by any chance defined it as having only 100 characters?


  e.g. .Fields.Append "DESCRIPTION", adVarChar, 100


 


  I would suggest you review the RecordSet structure (more than likely you made that chance on the CreateProductsRSStructure function of the "Insert Opportunity Common" script.


 

[Reply][Quote]
David Nunnally
Posts: 206
 
Re: text field in datagrid throws error when len>100Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 May 11 8:51 AM
fiogf49gjkf0d

I just test something.


The following line throws an error


.Fields("DESCRIPTION").Value = "Remote Wireless PC X Tablet T7700 Wireless Single Operator Remote (PC and Wireless Access Point are not included)"


The following works.


.Fields("DESCRIPTION").Value = "Remote Wireless PC X Tablet T7700 Wireless Single Operator Remote (PC & WAP are not included)"


So I know it has to do entirely with the grid recorset since I eliminated the other recordset. Not that this revelation helps me but....

[Reply][Quote]
David Nunnally
Posts: 206
 
Re: text field in datagrid throws error when len>100Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 May 11 9:17 AM
fiogf49gjkf0d

BANG! You nailed it Raul. Looked all over that! Since this is a text field (product.description) what should I set it to?

[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: text field in datagrid throws error when len>100Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 May 11 9:21 AM
fiogf49gjkf0d

The grid will not host a Memo field, so you still need to keep it as a VarChar.


My recommendation:


Make it a VarChar 255, and then on either the SQL statement or on the Assignment take the Leftmost 255 characters.


 

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: text field in datagrid throws error when len>100Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 May 11 10:01 AM
fiogf49gjkf0d

Hi Raul


Yes, it does ? If the type is (14) - which was what it was set to (in the 2nd one he did). But, good spot on the info that wasn't provided


Regards
Mike


 

[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: text field in datagrid throws error when len>100Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 May 11 7:34 PM
fiogf49gjkf0d

Mike, you are correct, i was thinking groups.


 


As per Mike's comment, you can declare your field as Text as well (type 14), but you may also want to change your column type on the grid to hold the memo field.

[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): 7/5/2025 6:46:07 AM