Login / Register  search  syndication  about

          Jason Buss' Blog

Jason Buss on SalesLogix development & customization, SQL, and more.

Updating text within Textblob fields in SalesLogix

I had a request to post on how you could replace characters within a Blob field in the SalesLogix database. Blob fields are database fields that hold any sort of binary information (such as text, images, audio, etc..), but SalesLogix uses them primarily for holding large amounts of text, since you don't have to define a field length. The Longnotes field in the History table is a good example.

Updating these types of fields is simple. You can perform a SQL update statement like you would on any other type of field in the database. The only caveat is that you need to perform a cast on the blob field so that it is evaluated as a VarChar, otherwise you will get an error regarding the Blob datatype.

The update will only be performed for the length you specify in your cast, therefore you'll need to cast it large enough to encompass the largest amount of data you may have in that field.

If you wanted to replace any instance of the "pipe" symbol ( | ) with the "at" symbol ( @ ) for example, you could perform the following update:

 update HISTORY set LONGNOTES = REPLACE(cast(LONGNOTES as varchar(5000)), '|', '@')

Note that I am casting the Longnotes field to a VarChar with a length of 5000.  In most cases, that should be plenty of space to include all text, but your situation may require a larger cast.

This statement can be ran directly in the SQL Server Management Studio or Query Analyzer, or if you have a LAN system and need to consider synchronization, you can run this in the Execute SQL functionality under the Tools menu in the SalesLogix Workgroup Administrator.  Since the data is being updated directly in the SQL database, this will work for both LAN and Web implementations.

Keep in mind that the History.Notes field contains the first 255 characters of the History.Longnotes field for display purposes, so you would want to perform the same update on both fields.

Thanks for reading!

Tags: ,
What's This?
  
Bookmark and Share

About Jason Buss

   Jason is a senior application developer with Customer FX.



Related Content
   Summary and GroupBy of data using IRepository and projections
In the SalesLogix web client, you don't really have the same old options regarding Queries and Datase
Posted on Apr 05, 2012 by Jason Buss to Jason Buss' Blog
 
   Exporting Table data via the SalesLogix web client
Recently, I had a request to create export functionality for a datagrid in the SalesLogix web client. I
Posted on Feb 22, 2012 by Jason Buss to Jason Buss' Blog
 
   Missing Properties/Toolbox window in SalesLogix LAN
If you work on SalesLogix across a number of remote desktop connections and a number of different worksta
Posted on Jan 25, 2012 by Jason Buss to Jason Buss' Blog
 
   Populating fields from a lookup result set in the SalesLogix web client
Recently, I needed to create an account tab in the web client which would show a number of values from a
Posted on Jan 11, 2012 by Jason Buss to Jason Buss' Blog
 
   Modifying the QuickFind Lookup in the SalesLogix LAN client
The Quick Find functionality in the SalesLogix web client is a fast and easy way to look up information f
Posted on Nov 02, 2011 by Jason Buss to Jason Buss' Blog
 
Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2013 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register