Welcome to Forums Sign in | Join | Help | Forums
in Search


Automated Queue with Windows scheduler - solution

Last post 01-13-2004 11:45 AM by obsvid obsidman. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-05-2004 3:10 PM

    Automated Queue with Windows scheduler - solution

    This code runs a predefined RE:Queue from VBA. That means that you are able to schedule it using Window's Scheduler to run however frequently you want without having to reset it or requeue it (as is currently the case) Note this code uses libraries that are not supported by Blackbaud so if you don't feel happy about using it then... don't. For both pieces of code you will need to add the references: Blackbaud RE QUEUE Data Objects 7.5 Blackbaud RE QUEUE UI Objects 7.5 Firstly you need a queue id. This can be found by setting up a list object (lstQueue below) and populating it with the ids and the queue descriptions. [code] Dim oQueues As New CQueues Dim oQueue As CQueue oQueues.Init REInit.getSessionContext For Each oQueue In oQueues lstQueue.AddItem oQueue.Fields(QUEUE_fld_ID) & ": " & oQueue.Fields(QUEUE_fld_NAME) Next oQueue oQueues.CloseDown Set oQueues = Nothing [/code] Once you have obtained the queue id you can feed it into the next method. Here I use a module called REInit that initializes Raiser's Edge (this is well documented by Blackbaud) and returns the session context. [code] Private Sub doQueue(qId As String) On Error GoTo doQueue_error Dim qServ As New CQueueServer qServ.Init REInit.getSessionContext qServ.ExecuteQueue CLng(qId), bShowProgressFormUI:=False qServ.CloseDown Exit Sub doQueue_error: 'MsgBox "Error in doQueue: " & Err.Number & " - " & Err.Description If Not qServ Is Nothing Then qServ.CloseDown End If End Sub [/code] You will need to create this as a program that accepts the queue id as a parameter. Parse the incoming parameters by setting a variable to those parameters. e.g. [code] Dim parameters As String parameters = Command() [/code] The program exe together with id should then be put in command line to the Windows Scheduler (found in control panel) and dates and times set accordingly. For more information about the Window Scheduler see Windows help. Please use this code freely, all I ask is that you let me know - its nice to know how many people have seen this!! David Zeidman Jewish Community Federation San Francisco [i]--- Edited at 1/22/2004 3:26:49 PM by [Email Removed][/i]
  • 01-05-2004 11:33 PM In reply to

    Automated Queue with Windows scheduler - solution

    Thanks - I will pass this onto my programmers - We were just discussing the need for a solution to this problem. We have developed a number of macros and just gone live on RE7.6 so still busy fighting fires! Small ones though. Thanks again, Bernadette Maguire. Oxfam Community Aid Abroad Australia
  • 01-08-2004 9:38 AM In reply to

    Automated Queue with Windows scheduler - solution

    David -- Hello from CT! It was great to meet you at the Conference in Charleston in October. One question on your posting: would we need the RE:API license for this? We currently have VBA, but have avoided the cost of API so far. Thanks for your help. Jay Dardis IT Manager Legion of Christ, Inc.
  • 01-13-2004 11:45 AM In reply to

    Automated Queue with Windows scheduler - solution

    Hi Jay! Nice to hear from you. I am not really sure. We have both RE:API and VBA (actually I didn't know that there was a difference between the two). As I have written it the queue program is a freestanding program. In fact if it is going to scheduled with Windows then it has to be free standing. I guess that would then mean having the API too. David
Page 1 of 1 (4 items)