Author Topic: Letter Express Automation  (Read 4697 times)

Offline pivotalnd

  • Sr. Member
  • ****
  • Posts: 55
  • Karma: +0/-0
  • Gender: Male
    • View Profile
Letter Express Automation
« on: November 22, 2007, 01:00:10 AM »
Hi ALL,

To run an LE we first select the template then the option of what data to use - entire sys, individual record etc., then view or run the LE.

But, can we automate the entire process for a single click via a button which will print the document based on the LE template that has been defined without having to go through the above process?

Thanks in advance for any help
Regards,
Pivotalnd.

Offline Bhupesh

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
  • Gender: Male
    • View Profile
    • GrapeCity India Pvt. Ltd.
Re: Letter Express Automation
« Reply #1 on: November 22, 2007, 07:10:27 AM »
Hi,

You can use the following Client Script Code to achieve this from a button on the RC.

' -------------------------------------------------------------------------------------------
' Name: RunLetterEx
'--------------------------------------------------------------------------------------------
' Purpose: This method is used to run the letter express
' -------------------------------------------------------------------------------------------
' Inputs:
' strLetterExName - Name of the Letter Ex Template
' intFilter - Filter Option to use
' vntFilterValue - Filter value
' Outputs: None
' Returns: Nothing
' -------------------------------------------------------------------------------------------
' History:
' Revision# Date Author Description
' --------------- -------- ------- --------------------------
' 1.0 22-Nov-2007 AS Initial version
' -------------------------------------------------------------------------------------------
Sub RunLetterEx (strLetterExName, intFilter, vntFilterValue)

'Variable Declarations ---
Dim objLetterEx
Dim intCnt
'-------------------------

On Error Resume Next

'Create Letter Ex Object ----
Set objLetterEx = UIMaster.GetStealthLetterExpress(strLetterExName)
'-------------------------

'Set the Destination ----
'0-Printer, 1- Fax, 2 - Email
objLetterEx.Destination = 0 'Printer
'-----------------------------

'Set the Filter Option --------------
' Filter Options Available 0-Entire System, 1- Static List, 2- Query, 3- Individual Record
'Corressponding values Null, Static List Id, Active Search ID, Record Id
objLetterEx.UseRecordsFrom intFilter, vntFilterValue
'----------------------------------

'Retreive Data ---
intCnt = objLetterEx.RetrieveData()
'-------------------

'If Data is returned then run letter ex ----
If intCnt > 0 Then
objLetterEx.RunLetterExpressFromScript
Else
Global.CMSMsgBox "No Data Found", vbOkOnly, "Auto Letter Express"
End If
'-------------------


This is a generic piece of code that we use quite regularly in our project.

Let us know if you need more help in this regard.

Cheers,
Bhupesh.
GrapeCity India Pvt. Ltd.
Bhupesh Malhotra
GrapeCity India Pvt. Ltd.

Offline pivotalnd

  • Sr. Member
  • ****
  • Posts: 55
  • Karma: +0/-0
  • Gender: Male
    • View Profile
Re: Letter Express Automation
« Reply #2 on: November 26, 2007, 12:54:57 AM »
Hi,

Thank you very much for your timely help. Appreciate the effort and time.

Regards,
Pivotalnd.