Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, November 21, 2024 
 
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 19001 times

Rating: - 5.0 out of 5 by 1 users
 

fiogf49gjkf0d
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

fiogf49gjkf0d

Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix since 2001 and believes in sharing with the community. He loves C#, Javascript, Python, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

View Ryan's SalesLogix Mobile Seveloper Series
View Ryan's SalesLogix SData Developer Series
View Ryan's Git for the SalesLogix Developer series



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
fiogf49gjkf0d
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
fiogf49gjkf0d
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
fiogf49gjkf0d
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
fiogf49gjkf0d
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
fiogf49gjkf0d
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
fiogf49gjkf0d
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
fiogf49gjkf0d
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
fiogf49gjkf0d

sorry .... line of code is:

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

 
Ademar Nunes
 

Re: The SalesLogix Mail Merge SDK - An In-Depth Example
Posted: 8/25/2017 9:09:02 AM

Could you clarify to me how to add the MergeWith switch so it will link the Opportunity to the hisotry created?


I implemented this code as an include script and I have it set to record a history but it isn't linking the Opportunity to the History.


On the Form Event itself this is all I have:


MailMerge EntityID, PluginID, 1, "True", "", "True", "True", "", "", "", ""


It performes the merge, creates the history, links the Account and the Contact to the history, but doesn't link the Opportunity. How do I go about having it link the Opportunity?


Thanks.

 
 

       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 © 2024 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): 11/21/2024 2:20:09 PM