Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, August 24, 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: Import History LongNote?
Jill D
Posts: 31
 
Import History LongNote?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jun 08 5:53 PM
Hello,
We have an import plugin that brings in data from an xls spreadsheet. It creates a SO record, then a History record and an Activity record. It is erroring (data would be truncated
) on the import to the History LONGNOTE column. If the import is limited to 255 characters for the LONGNOTE column, it works fine. The column is defined as TEXTBLOB in the db so I don't understand why the upload wants to truncate the data. Is it possible to import more than 255 into the LongNotes field?
SLX is 7.2 with some legacy stuff
SQL server 2005
SLX OLE DB provider
VBScript plugin

thanks!
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: Import History LongNote?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jun 08 6:21 PM
Jill,

The problem is likely due to the fact that the code is using the same source data or variable to write to the Notes field which is only 255 characters long. The code needs to explicilty truncate the data for that field.

For example:

recordset.fields.item("Notes") = LEFT(sNotes, 255)
recordset.fields.item("LongNotes") = sNotes

HTH,

Timmus
[Reply][Quote]
Jill D
Posts: 31
 
Re: Import History LongNote?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jun 08 6:26 PM
thanks - we are using:

LongNotes = CallerName & Chr(13) & Chr(10) & Acctnum & Chr(13) & Chr(10) & ROContactName & Chr(13) & Chr(10) & Description
Notes = Left(LongNotes, 255)

[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: Import History LongNote?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jun 08 6:40 PM
That looks like it should . At this point I would suggest posting the actual ado code for writing to the database. We may be able to spot the issue for you.

Timmus
[Reply][Quote]
Jill D
Posts: 31
 
Re: Import History LongNote?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Jun 08 10:09 AM
Thanks for your help - code is below for history import.

j



'create history record
form.Caption = "Importing ( " & CurRow & " of " & Tr & " ) - Step 2"

HistoryID = Application.BasicFunctions.GetIDFor("History")

C_Type = "262148"
set conn = Application.GetNewConnection
set rs = CreateObject("ADODB.Recordset")
SQLStmt = "SELECT OpportunityID, AccountID FROM VS_Machines WHERE VS_MachinesID = '" & VS_MachinesID & "'"
rs.Open SQLStmt, conn
AccountID = rs.Fields("AccountID")
OpportunityID = rs.Fields("OpportunityID")
rs.Close
ContactID = ""
SQLStmt = "SELECT Account FROM Account WHERE AccountID = '" & AccountID & "'"
rs.Open SQLStmt, conn
Acnt = rs.Fields("Account")
rs.Close
ContactName = ""
C_Priority = ""
Category = "Service Orders"
' Description = GeneralReason
LongNotes = CallerName & Chr(13) & Chr(10) & Acctnum & Chr(13) & Chr(10) & ROContactName & Chr(13) & Chr(10) & Description

Notes = Left(Notes, 255)
' OpportunityID =
SQLStmt = "SELECT Description FROM Opportunity WHERE OpportunityID = '" & OpportunityID & "'"
rs.Open SQLStmt, conn
Opportunity = rs.Fields("Description")
rs.Close
OpportunityName = Opportunity
StartDate = DateAddw(4, CDate(now()))
Duration = ""
TimeLess = "T"
UserID = Application.BasicFunctions.CurrentUserID
UserName = ""
OriginalDate = ""
Result = ""
ResultCode = ""
CompletedDate = ""
CompletedUser = ""
Userdef1 = ""
UserDef2 = ""
Userdef3 = ""
dim desc
desc = SO_Type & " " & GeneralReason
'msgbox notes
'msgbox longnotes
nr = Create_History_Record(HistoryID, ActivityID, C_Type, AccountID, ContactID, OpportunityID, Acnt, ContactName, OpportunityName, C_Priority, Category, StartDate, Duration, desc, TimeLess, UserID, UserName, OriginalDate, Result, ResultCode, CompletedDate, CompletedUser, Notes, Userdef1, UserDef2, Userdef3, LongNotes)
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Import History LongNote?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Jun 08 1:14 PM
Shouldn't this line:
Notes = Left(Notes, 255)


Really be this?
Notes = Left(LongNotes, 255)


Other than that, it's the contents of Create_History_Record that we'd need to see to help.
[Reply][Quote]
Jill D
Posts: 31
 
Re: Import History LongNote?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Jun 08 11:40 AM
Thanks for your help. We've decided to enforce a character limit for imports to LongNotes - if you can't say it in 255 characters, you will need to be less verbose!

j
[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): 8/24/2025 7:00:28 AM