Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, June 18, 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: Modifying the SLX Mail Merge OnCustomFieldName VBScript
Lee
Posts: 22
 
Modifying the SLX Mail Merge OnCustomFieldName VBScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Apr 07 5:08 AM
Hi Guys

I'm brand new here but I've done loads of research into this and genuinely have tried to fix the problem myself - I'm not just looking for an easy way out!

I have got my SQL code working but I'm struggling to pull any data out of the SQL back end.

' Dim strSQL, strAdd1
' Dim objRS, objSLXDB

' Set objSLXDB = New SLX_DB


' strSQL = "Select ADDRESS.ADDRESS1 From ACCOUNT Inner Join ADDRESS " & _
' "On ACCOUNT." & strAddressID & " = ADDRESS." & strAddressID & " " & _
' "Where (ACCOUNT." & strAccountID & " = :" & strAccountID & ")" 'DNL

' Set objRS = objSLXDB.GetNewRecordset
' objRS.Open strSQL, objSLDB.Connection

' strAdd1 = strSQL???

I'm trying to get the value of Address Line 1 into the string strAdd1 but I keep getting an error saying a variable is undefined.

Can anyone help?

Thanks in advance.

Lee
[Reply][Quote]
Lloy Sanders
Posts: 69
 
Re: Modifying the SLX Mail Merge OnCustomFieldName VBScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Apr 07 8:24 AM
fiogf49gjkf0d
Try this:

Dim strSQL, strAdd1
Dim objRS, objSLXDB
Set objSLXDB = Application.GetNewConnection
strSQL = "Select ADDRESS.ADDRESS1 From ACCOUNT Inner Join ADDRESS " & _
"On ACCOUNT." & strAddressID & " = ADDRESS." & strAddressID & " " & _
"Where (ACCOUNT." & strAccountID & " = :" & strAccountID & ")" 'DNL
Set objRS = objSLXDB.Execute (strSQL)
strAdd1 = objRS.Fields(0).Value
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: Modifying the SLX Mail Merge OnCustomFieldName VBScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Apr 07 7:34 AM
fiogf49gjkf0d
Quote:
Originally posted by Lee

Hi Guys

I'm brand new here but I've done loads of research into this and genuinely have tried to fix the problem myself - I'm not just looking for an easy way out!

.....

Can anyone help?

Thanks in advance.

Lee


What you need is to get a basic understanding about ADO recordsets.
I'd suggest the following:
A - Article on THIS site: http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=76
B - Get a copy of David Sussman's ADO Programmer's Reference (it's THE guilde on ADO) - Try Amazon
C - There are several good web sites w/reference materials on ADO. A quick Google on VBScript ADO should get you in the ball park.
D - As Lloyd said in his posting... strAdd1 = objRS.Fields(0).Value
--
rjl
[Reply][Quote]
Ron Buchanan
Posts: 72
 
Re: Modifying the SLX Mail Merge OnCustomFieldName VBScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Apr 07 12:06 PM
fiogf49gjkf0d
Lee,
Of course there's some info missing from the snippet, but where are the DIM statements for strAccountID and strAddressID. I've done some work with the address table, and typically use strEntity to reference the Address Type, I'm attempting to find.

Hope this helps,
Ron
[Reply][Quote]
Lee
Posts: 22
 
Re: Modifying the SLX Mail Merge OnCustomFieldName VBScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Apr 07 3:14 AM
fiogf49gjkf0d
Thanks for all the responses guys you've been a great help.

Ron, the DIM statements look like this:

strAccountID = Application.BasicFunctions.GlobalInfoFor(GLOBALINFO_AccountID)
strAddressID = Application.BasicFunctions.GlobalInfoFor(GLOBALINFO_AddressID)

I ended up using GetField() because I couldn't get any other method to work:

strField = "Address1"
strTable = "sysdba.Address"
strWhere = "(ADDRESSID = '"& strAddressID &"')"

strValue = GetField(strField, strTable, strWhere)

This seems to work and I've managed to do everything I wanted to do.

Thanks again for all the help.

Lee
[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/18/2025 12:31:53 AM