Calling Merge Forms in SalesLogix LAN VBScript

Recently, I’ve been working on a customization which calls for one of a number of Merge Forms to be ran based on certain criteria.  This is a pretty simple process, and here’s how I did it:

First of all, I need to get the pluginid for the appropriate Merge Form, based on my criteria.  This can be found in the “Plugin” table, based on the plugin type of 25, and the name of the Form.  In this case, these forms have been created by Admin, so the userid is the standard SYST00000001 value:

Select Case {value}

Case {condition1}

     sPluginID = GetDataValue(“pluginid”, “plugin”, “name = ‘MergeForm1’ and userid = ‘SYST00000001’ and type = 25”) 

Case {condition2}

     sPluginID = GetDataValue(“pluginid”, “plugin”, “name = ‘MergeForm2’ and userid = ‘SYST00000001’ and type = 25”) 

Case Else

     sPluginID = GetDataValue(“pluginid”, “plugin”, “name = ‘MergeForm3’ and userid = ‘SYST00000001’ and type = 25”) 

End Select

After getting the plugin, we just need to use the “MergeFromPlugin” function within SalesLogix.  This function takes a few parameters:  The first, PluginID, is simply the pluginid that I got from the case statement.  The second parameter is the Merge mode.  1 = Email, 2 = Fax and 3 = Letter.  The next parameter is ContactID, and the final parameter is OpportunityID.  The OpportunityID parameter is optional to this function.

application.BasicFunctions.MergeFromPlugin sPluginID, 2, sContactID, sOpportunityID

That’s all there is to it!  This function will return a True if the merge is performed successfully, and false if not.

 Thanks for reading!  I hope you find this helpful.  :)

ABOUT THE AUTHOR

Jason Buss

Jason is a senior application developer with Customer FX.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) news and product updates!

You have Successfully Subscribed!