Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, May 19, 2013 
 
The SalesLogix Mail Merge SDK - An In-Depth Example  
Description:  The following example performs a mail merge entirely using VBscript. The example contained in this document is fairly complex and utilizes some previously undocumented functions. The MergeFormFile function and the SalesLogix Document Definition file format (.SDD) are used and detailed.

Category:  Documentation
Author:  Ryan Farley
Submitted:  8/7/2006
   
Stats: 
Article has been read 7923 times

Rating: - 5.0 out of 5 by 1 users
 

The SalesLogix Mail Merge SDK - An In-Depth Example

The following example performs a mail merge entirely using VBscript. The example contained in this document is fairly complex and utilizes some previously undocumented functions. The MergeFormFile function and the SalesLogix Document Definition file format (.SDD) are used and detailed.

 Click here to download

Please note, this is an official sage document outlining the Mail Merge SDK. Posted with permission.

 

About the Author

  Ryan Farley
(SalesLogix Business Partner)
Customer FX Corporation

I am the creator of slxdeveloper.com. As the developer, architect, chief editor of the slxdeveloper.com site, I attempt to build and support the SalesLogix developer community as much as possible, supporting my fellow business partners and providing a place where companies with SalesLogix can learn more about developing and integrating with SalesLogix.

For my day job, I lead all development efforts for Customer FX Corporation as the Director of Development. I work from my home in Arizona but find myself often in Minnesota. I have worked with SalesLogix since it's version 2.13 release and have architected & developed several large applications & frameworks built on new technologies that make use of SOAP, XML, web & windows services while integrating with SalesLogix. Those who know me understand that I am not someone who enjoys spending time in the Architect. Instead, I try to focus on taking SalesLogix to new levels and keep it up with current industry standards and technological advances.

I have 15+ years of formal programming experience using several languages such as C#, Delphi, Visual Basic, C++, T-SQL, & Java - but C# is my passion. You can read more about my love of programming and non-SalesLogix development articles on my personal weblog on RyanFarley.com, and more SalesLogix related entries on my SalesLogix weblog at CRM Developer.

Check out my new product Outlook2CRM - Easy, customizable, SalesLogix integration for Outlook!

Happy coding.


View online profile for Ryan Farley
 

[ back to top] [ send to a friend]  

Rate This Article you must log-in to rate articles. [login here] 
 
Please log in to rate article.
 

Comments & Discussion you must log-in to add comments. [login here] 
 
Author Article Comments and Discussion
Andre Beishuizen



Re: The SalesLogix Mail Merge SDK - An In-Depth Example
Posted: 11/9/2006 6:13:48 AM
Hi Ryan,

I have a template created with the ADMIN userid. I have used the VB script in the "Opportunity Detail" Form.
I did not fill in the Base options:

' Base options
' Set internally based on system settings
' oSLXDocument.MailMergeInformation.AttachmentPath = ""
' oSLXDocument.MailMergeInformation.BaseKeyCode = ""
' oSLXDocument.MailMergeInformation.BaseTable = ""
' oSLXDocument.MailMergeInformation.ConnectionString = ""
' oSLXDocument.MailMergeInformation.Remote = ""
' oSLXDocument.MailMergeInformation.SiteCode = ""
' oSLXDocument.MailMergeInformation.TransportType = transNative
' oSLXDocument.MailMergeInformation.UserID = ""

When I test a mail merge in the SalesLogix Client as ADMIN. The template is generated correctely.
When I test a mail merge in the SalesLogix Client as another user I get the error message:

The MailMerge Engine encountered an error and cannot continue. The requested Micosoft Word template was either not found in the database, or your security rights prevent you from using this template.

The template is released to everyone.

Do you have any idea ?

Regards,

Andre

 
Andre Beishuizen



Re: The SalesLogix Mail Merge SDK - An In-Depth Example
Posted: 3/8/2007 3:36:25 AM
I found the problem. I used the pluginid of the user who created the template. When you look in the table plugin you will find the same template also with userid SYST00000001 after releasing the template to everyone. Using that pluginid solved the problem.

Andre
 
Guy Barrett
 

Re: The SalesLogix Mail Merge SDK - An In-Depth Example
Posted: 6/28/2007 8:07:22 AM
All good stuff indeed. This was very easy to create a function with a few parameters that can be called on an ad-hoc basis.

However, there is something that I just can't figure out. When merging to a file, for a single contact, I cannot for the life of me return the path and name of the .doc that it has created. From what I can see you can only pass the directory that you want it to merge the .doc file to, but not the filename - and I cannot find a property to return the filename to me.

To make things clearer. I have two templates, one for an email and one for a word document.

I wish to merge to the word document template and then merge to the email template (attaching the orignally merged word doc in the process). The only issue I have is figuring out the path and filename of the word document.

Ryan, you've got a load of brain cells bobbling about in that bonce of yours. Do you have any ideas?
 
Guy Barrett
 

Re: The SalesLogix Mail Merge SDK - An In-Depth Example
Posted: 7/11/2007 4:53:07 AM
Hello again,

Has anyone had any luck with the oSLXDocument.AddAttachment() command when merging to email? I've tried pulling it apart in Visual Studio and have found the command...

AddAttachment(ByVal AttachmentType As SLXDoc.AttachmentType, ByVal FileID As String, ByVal FileName As String, ByVal FullPath As String, ByVal PluginAttachID As String)

However, I cannot get it to work at all! All I am trying to do is ...

oSLXDocument.MailMergeInformation.OverrideAttachments = False
oSLXDocument.AddAttachment atRegularAttachment, "", "test.doc", "c:\temp\", ""

Absolutely nothing.

Help?
 
RJ Samp

slxdeveloper.com Forum Top 10 Poster!

Re: The SalesLogix Mail Merge SDK - An In-Depth Example
Posted: 1/10/2008 12:58:52 PM
Has anyone worked with Opportunity Mail Merges and the current Custom Field script?


Looking for tips on how to post a table off of a table to Word.....

So I can Print the Opportunity Product Table.....but not
Opp Prod 1
Account Site 1
Account Site 2
Account Site 3
Opp Product 2
Account Site 1
Account Site 2
Account Site 6

Also has this SDK been updated at all?
Maybe some more stuff for Opportunity Mail Merges, for example?


Help?!!
 
jose
 

Re: The SalesLogix Mail Merge SDK - An In-Depth Example
Posted: 11/26/2010 3:43:50 PM
Hi this code work GREAT
i am using slx form 7.5
and its perfect
now i need to add attach by code
to the merge
using oSLXDocument.AddAttachment atRegularAttachment, "", "xxx.pdf", "\\xxx\", ""
but does not work
change all but does not work
please if any one know how it work please let me know
 
Marcel Heuberger
 

Re: The SalesLogix Mail Merge SDK - An In-Depth Example
Posted: 7/21/2011 9:36:42 AM
Hi Jose,

I see a lot of unclosed topics regarding "add attachament" using the MailMergeSDK.

I was struggling for days and finally I was able to attach attachments using the following line of code:

oSLXDocument.AddAttachment 2, "", "C:\Temp\Test.txt", ""

(I think the "2" is important to add attachments using UNC Path)

You can also program a loop to attach more then one attachment.

Hope it helps!

Cheers
Marcel

 
Marcel Heuberger
 

Re: The SalesLogix Mail Merge SDK - An In-Depth Example
Posted: 7/21/2011 9:51:27 AM

sorry .... line of code is:

oSLXDocument.AddAttachment 2, "", "C:\Temp\Test.txt", "C:\Temp\Test.txt", ""

 
 

       Visit the slxdeveloper.com Community Forums!
Not finding the information you need here? Try the forums! Get help from others in the community, share your expertise, get what you need from the slxdeveloper.com community. Go to the forums...
 



 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2013 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): 5/19/2013 2:21:30 PM