Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • in reply to: Programmatically accept an appointment #6528
    scaldwell
    Participant

      How does GroupWise itself handle this? When I proxy to an account it doesn’t require me to login. It only requires that the other account grant me proxy rights. Is this functionality that is unexposed in Formativ? I am using the technique you described to export calendar items from a proxied account.

      Is there a way to have the Account object change when you use the built-int proxy process in GroupWise? I am new to this development environment so this question may be odd. I am just trying to make this as seamless as possible. It would be nice to just click the proxy button at the bottom of the main groupwise window….add calendar items, edit calendar items with thier new status, and export them to a csv without having to use the multilogin. The security exists for this to occur without using multilogin, so why is it not possible to do it. It may be that it’s not possible to do it easily. I’ll understand that.

      Thanks for your help and advice.

      Scott Caldwell

      in reply to: Programmatically accept an appointment #6532
      scaldwell
      Participant

        This is in reference to the Clone Appointment code that Support 2 provied.

        If I’m proxied to another account and select an appointment the cloned appointment is created in my own account. I would like to cloned appointment to be created in the account of the original posted appointment. Sorry I didn’t mention that before. Thanks for your help.

        Scott Caldwell

        in reply to: Programmatically accept an appointment #6533
        scaldwell
        Participant

          Your suggestion does exactly what I want. Thanks to all who participated in this discussion. I had yet to discover the AddExistingMessage method.

          Your level of support is one of the best I’ve seen in a long time.

          Thanks,

          Scott

          in reply to: Programmatically accept an appointment #6527
          scaldwell
          Participant

            Thanks for your help. It is important that the original Posted Appointment be kept in the calendar and a new one created throught the clone method and posted on the new date. That way individuals referencing the calendar will be able to see a trail of events. When they look at the calendar they need to be able to see that the event on May 8, 2003 was rescheduled and what the new event date is. They can then find the new event which was cloned and sent to a new date and classified as an active event.

            I’m running into problems editing the cloned Posted Appointment. When it is cloned it appears in both the calendar view and the mail view. I must then accept it to remove it from the mail view. This makes me think that it’s not acting like a true Posted Appointment. When I clone it I have to send it in order to get it from the draft message status to the calendar (don’t I?). I take the sender from the original Posted Appointment and make that person (me in this case) the recipient of the cloned Posted Appointment. The problem editing problem comes up when the cloned Posted Appointment needs to be reclassed to canceled, or whatever, Groupwise says I don’t have rights to edit it. Is this because I sent it to my self…I thought that was how a Posted Appointment worked. Is there any way around this?

            Thanks again

            Scott

            in reply to: Programmatically accept an appointment #6526
            scaldwell
            Participant

              Here’s a brief description of what this applet is suppose to do.

              We are using another applet to export our calendars from GW to .csv files, which are then uploaded to our website content management system and displayed to the public.

              Each Posted Appointment (event) can have several status categories, which are assigned through the use of a custom field. The categories are Active, Canceled, Postponed, and Rescheduled. Posted appointments or events that are rescheduled are cloned, in order to preserve all event information (mainly attachments) and the startdate and status is reset. The startdate is set to the new event date and the status is set to active or “”. This is modelled of one of your sample applets.

              When the new Posted Appointment is created through the clone method (which works) it is sent to the sender of it’s parent. It then must be accepted by the user. Posted Appointments don’t need to be accepted…do they? It would be cleaner if the Posted Appointment could be auto accepted by the applet. The new Posted Appointment doesn’t seem to be behaving like a true Posted Appointment.

              I’ve tried this method on the new message with no luck:

               objAppt.Accept("Accept") 

              Also, after the Posted Appointment is cloned it wont let me edit it again. In theory, the event can then be canceled…but whe I run the applet on this new cloned appointment and try to set the status again it says:

               Message.Object
              C:Program FilesAdvansysFormativAF_EDIT_NEW.vbf
              Update access is denied to current user. at line 104, column 17 

              I’ve included the entire applet for your viewing pleasure…don’t laugh!! It’s my first time.

              Thanks for any help you can provide.

              Scott
              scaldwell@ci.fayetteville.ar.us

               
              
              '-------------------------------------------------------------------------------
              ' Insert your comments here
              '-------------------------------------------------------------------------------
              
              'Dialog Variables
              Dim Dialog1
              Dim Dialog2
              Dim Dialog3
              Dim PriorityCtl
              Dim StatusCtl
              Dim DateCtl
              Dim TimeCtl
              Dim MemoCtl
              
              'Miscellaneous Variables
              Dim Msg
              Dim Cmd
              Dim iCount
              Dim Field1
              Dim Field2
              Dim Field3
              Dim Fields
              Dim FieldDefs
              Dim FieldObj1
              Dim FieldObj2
              Dim FieldObj3
              Dim sIndex1
              Dim sIndex2
              
              Const CUSTOM_FIELD1 = "STATUS"
              Const CUSTOM_FIELD2 = "RESCDATE"
              Const CUSTOM_FIELD3 = "RESCREASON"
              Const CAPTION = "AccessFayetteville Calendar Tools"
              
              '-------------------------------------------------------------------------------
              ' Main Function
              '-------------------------------------------------------------------------------
              
              Sub Main(Client, GWEvent)
              
                'Command Buttons
                cIntroDlg = 100
                cSelectEdit = 101
                cCheckReschedule = 102
                cReschedule = 103
                cExit = 999
              
                'Set the default status to 0
                sIndex1 = 1
                sIndex2 = 0
              
                'Set starting point
                Cmd = cIntroDlg
              
                Do While Cmd <> cExit
                
                  If Cmd = cIntroDlg Then
                    'Get the number of messages selected
                    iCount = Client.ClientState.SelectedMessages.count
                    If iCount > 1 Then
                      MsgBox("This applet only allows single calendar events to be edited")
                      Cmd = cExit
                    Else
                      Set Msg = Client.ClientState.CommandMessage
                      AddFields
                      FieldValues
                      'Check message priority and pass to form
                      If Msg.Priority = 1 Then
                        sIndex1 = 0
                      Elseif Msg.Priority = 2 Then
                        sIndex1 = 1
                      Elseif Msg.Priority = 3 Then
                        sIndex1 = 2
                      End If
                      'Checks that some text is in the status field before checking for values
                      If IsObject(Field1) then
                        'Check custom status field for values and pass to form
                        If Field1.Value = "Canceled" Then
                          sIndex2 = 1
                        Elseif Field1.Value = "Postponed" Then
                          sIndex2 = 2
                        Elseif Field1.Value = "Rescheduled" Then
                          sIndex2 = 3
                        Else
                          sIndex2 = 0 'blank value for status signifies Active event
                        End If
                      End If
                      
                      'Create the Dialogs
                      Call SetupIntroDlg(sIndex1, sIndex2)
                      Select Case Dialog1.execute
                        Case Btn1 Cmd = cSelectEdit
                        Case Btn2 Cmd = cExit
                        Case Else Cmd = cExit
                      End Select     
                    End If
                  End If
                      
                  If Cmd = cSelectEdit Then
                    'Update the priority field if the new priority is different from the old priority
                    If (PriorityCtl.ItemIndex) <> sIndex1 Then
                      Select Case PriorityCtl.ItemIndex
                        Case 0 Msg.Priority = fgwLow
                        Case 1 Msg.Priority = fgwNormal
                        Case 2 Msg.Priority = fgwHigh
                      End Select
                    End If    
              
                    'Update the status field if the new status is different from the old status
                    If (StatusCtl.ItemIndex) = sIndex2 Then
                      If Field1 = "Rescheduled" Then
                        Cmd = cCheckReschedule
                      Else
                        Cmd = cExit
                      End If        
                    Else
                      If Field1 = "" Then
                        Select Case StatusCtl.ItemIndex
                          Case 1 Call Fields.Add(CUSTOM_FIELD1, fgwString, "Canceled")
                          Case 2 Call Fields.Add(CUSTOM_FIELD1, fgwString, "Postponed")
                          Case 3 Call Fields.Add(CUSTOM_FIELD1, fgwString, "Rescheduled")
                        End Select
                        Cmd = cCheckReschedule        
                      ElseIf Field1 = "Canceled" Then
                        MsgBox("CANCELED items may not be changed")
                        Cmd = cIntroDlg
                      ElseIf Field1 = "Postponed" Then
                        Select Case StatusCtl.ItemIndex
                          Case 1 Call Fields.Add(CUSTOM_FIELD1, fgwString, "Canceled")
                          Case 3 Call Fields.Add(CUSTOM_FIELD1, fgwString, "Rescheduled")
                        End Select
                        If StatusCtl.ItemIndex = 1 or StatusCtl.ItemIndex = 3 Then
                          Cmd = cCheckReschedule
                        Else
                          MsgBox("POSTPONED items may only be CANCELED or RESCHEDULED")
                          Cmd = cIntroDlg
                        End If
                      ElseIf Field1 = "Rescheduled" Then
                        MsgBox("Only the explanation of a RESCHEDULED item may be changed")
                        Cmd = cCheckReschedule
                      End If
                    End If
                  End If
                  
                  'MsgBox(Field1)
                  'MsgBox(StatusCtl.ItemIndex)
                  
                  If Cmd = cCheckReschedule Then
                    If Field1 = "Rescheduled" Then
                      Call SetupExpDlg
                      Select Case Dialog3.execute
                        Case Btn1 Cmd = cReschedule
                        Case Btn2 Cmd = cReschedule
                        Case Else Cmd = cExit
                      End Select
                    ElseIf StatusCtl.ItemIndex = 3 AND Field1 <> "Rescheduled" Then
                      Call SetupSuppDlg
                      Select Case Dialog2.execute
                        Case Btn1 Cmd = cReschedule
                        Case Btn2 Cmd = cReschedule
                        Case Else Cmd = cExit
                      End Select
                    End If
                  End If 
                  
                  If Cmd = cReschedule Then
                    If (MemoCtl.Text = "") OR (MemoCtl.Text = " ") Then
                      MsgBox("Explanations are REQUIRED for all rescheduled events")
                      Cmd = cCheckReschedule
                    Else 
                      'If original is reschedule then only update the explanation
                      If Field1 = "Rescheduled" Then
                        Call Fields.Add(CUSTOM_FIELD3, fgwString, MemoCtl.Text)
                        Cmd = cExit
                      'If the new status is reschedule then add new date/time and explanation
                      ElseIf (StatusCtl.ItemIndex = 3) Then
                        DT = (DateCtl.Date) + (TimeCtl.Time)
                          If (Msg.StartDate) = DT Then
                            MsgBox("The RESCHEDULED date and time must be different from the original")
                            Cmd = cCheckReschedule
                          Else
                            Call Fields.Add(CUSTOM_FIELD2, fgwDate, DT)
                            Call Fields.Add(CUSTOM_FIELD3, fgwString, MemoCtl.Text)
                            Call CreateNewEvent
                            Cmd = cExit
                          End If
                      End If
                    End If
                  End If
              
                Loop
              
              ' Refresh view
              Call GroupWise.Refresh
              
              'Clean up variables
              Set Fields = nothing
              Set Field1 = nothing
              'Set Field2 = nothing
              Set Field3 = nothing
              Set FieldObj1 = nothing
              Set FieldObj2 = nothing
              Set FieldObj3 = nothing
              Set Dialog1 = nothing
              Set Dialog2 = nothing
              Set Dialog3 = nothing
              Set PriorityCtl = nothing
              Set StatusCtl = nothing
              Set DateCtl = nothing
              Set MemoCtl = nothing
              Set Msg = nothing
              
              End Sub
              
              '-------------------------------------------------------------------------------
              ' Creates a new message when an event is rescheduled
              '-------------------------------------------------------------------------------
              function CreateNewEvent
              
                Dim objAppt
                Dim objNewAppt
                Dim objRecipient
                Dim NewAddress
                NewAddress = Msg.Sender
                ' Create a copy of the original Posted Appointment substituted the new date for the StartDate
                Set objAppt = Msg.Clone
                ' Set the recipient equal to the original sender which was ourself
                Set objRecipient = objAppt.Recipients.Add(NewAddress,,0)   
                With objAppt 
                  '.OnCalendar = TRUE
                  '.Priority = Msg.Priority
                  '.FromText = "Auto Generated Event"  
                  '.Place = Msg.Place
                  .StartDate = (DateCtl.Date) + (TimeCtl.Time)
                  '.EndDate = DT + 1      
                  '.Subject = Msg.Subject
                  '.BodyText.PlainText = Msg.BodyText
                End With
                
                objAppt.Accept("Accept")
                ' Get Fields of new message
                Set Fields = objAppt.Fields
                ' Set Status of new message to normal
                Call Fields.Add(CUSTOM_FIELD1, fgwString, " ")
                ' Send Message
                Set objNewAppt = objAppt.Send
                ' Clean up
                Set objRecipient = Nothing
                Set objAppt = Nothing
              
              End function
              '-------------------------------------------------------------------------------
              ' Adds the custom fields if they do not exist
              '-------------------------------------------------------------------------------
              function AddFields
                 
                Set FieldDefs = GroupWise.Account.FieldDefinitions
                
                On Error Resume Next     
                Set FieldObj1 = FieldDefs.Item(CUSTOM_FIELD1, fgwString)
                Set FieldObj2 = FieldDefs.Item(CUSTOM_FIELD2, fgwDate)
                Set FieldObj3 = FieldDefs.Item(CUSTOM_FIELD3, fgwString)
                ' If the custom fields don't exist in the field definitions then add them.
                If FieldObj1 Is Nothing Then
                  Call FieldDefs.Add(CUSTOM_FIELD1, fgwString) 
                Elseif FieldObj2 Is Nothing then
                  Call FieldDefs.Add(CUSTOM_FIELD2, fgwDate)
                Elseif FieldObj3 Is Nothing then
                  Call FieldDefs.Add(CUSTOM_FIELD3, fgwString)
                End If
              
                ' Refresh view
                Call GroupWise.Refresh
                
              End function
              
              '-------------------------------------------------------------------------------
              ' Get the values of the custom fields
              '-------------------------------------------------------------------------------
              function FieldValues
                
                ' Contains all field objects for the current message
                Set Fields = Msg.Fields
                 
                On Error Resume Next
                ' Finds the specified field objects and there values    
                Set Field1 = Fields.Item(CUSTOM_FIELD1, fgwString)
                'Set Field2 = Fields.Item(CUSTOM_FIELD2, fgwDate)
                Set Field3 = Fields.Item(CUSTOM_FIELD3, fgwString)
                
              End function
              
              '-------------------------------------------------------------------------------
              ' Dialog to edit the status dialog of the event 
              '-------------------------------------------------------------------------------
              function SetupIntroDlg(sIndex1, sIndex2)
              
                Set Dialog1 = Utilities.NewControlBoxDialog
                With Dialog1
                  .Height = 240
                  .Caption = CAPTION    
                  .Title = "Event Classification"
                  .ShowWizardImage = FALSE
                End With
                
                Set PriorityCtl = Dialog1.AddRadioGroupControl
                With PriorityCtl
                  .Caption = "Priority"
                  .Items.Add("Low")
                  .Items.Add("Normal")
                  .Items.Add("High") 
                  .ItemIndex = sIndex1
                  .Height = 40  
                  .Columns = 3
                  .Hint = "Select an event priority"
                End With
                
                Set StatusCtl = Dialog1.AddRadioGroupControl
                With StatusCtl
                  .Caption = "Status"
                  .Items.Add("Active")
                  .Items.Add("Canceled")
                  .Items.Add("Postponed")
                  .Items.Add("Rescheduled")  
                  .ItemIndex = sIndex2
                  .Height = 60  
                  .Columns = 2
                  .Hint = "Select an event status"
                End With
              
              End function
              
              '-------------------------------------------------------------------------------
              ' Dialog to edit reschedule information for an event 
              '-------------------------------------------------------------------------------
              Function SetupSuppDlg
              
                Set Dialog2 = Utilities.NewControlBoxDialog
                With Dialog2
                  .Height = 460
                  .Caption = CAPTION    
                  .Title = "Reschedule Information"
                  .ShowWizardImage = FALSE
                End With
              
                Set DateCtl = Dialog2.AddDateTimeControl
                with DateCtl
                  .Caption = "Reschedule Date To:"
                  .Kind = fdtkDate
                  .Date = Msg.StartDate
                  .MinDate = Date
                  .CaptionWidth = iCaptWidth
                  .CaptionAlign = ftaRightJustify
                  .Hint = "Enter a new date for this event"
                end with
              
                Set TimeCtl = Dialog2.AddDateTimeControl
                with TimeCtl
                  .Caption = "Reschedule Time To:"
                  .Kind = fdtkTime
                  .Time = Msg.StartDate
                  .CaptionWidth = iCaptWidth
                  .CaptionAlign = ftaRightJustify
                  .Hint = "Enter a new time for this event"
                end with
                
                Set MemoCtl = Dialog2.AddMemoControl
                with MemoCtl
                  .Caption = "I am rescheduling this event because:"
                  .ScrollBars = 4
                  .Text = field3
                  .CaptionAlign = ftaRightJustify
                  .WordWrap = TRUE
                  .hint = "Enter an explanation for this reschedule"
                end with 
              
              end Function
              
              '-------------------------------------------------------------------------------
              ' Dialog to edit reschedule explanation 
              '-------------------------------------------------------------------------------
              Function SetupExpDlg
              
                Set Dialog3 = Utilities.NewControlBoxDialog
                With Dialog3
                  .Height = 425
                  .Caption = CAPTION    
                  .Title = "Reschedule Information"
                  .ShowWizardImage = FALSE
                End With
                  
                Set MemoCtl = Dialog3.AddMemoControl
                with MemoCtl
                  .Caption = "Edit Explanation:"
                  .ScrollBars = 4
                  .Text = field3
                  .CaptionAlign = ftaRightJustify
                  .WordWrap = TRUE
                  .hint = "Enter an explanation for this reschedule"
                end with 
              
              end Function
              
              
              in reply to: Access Proxy Accounts #8507
              scaldwell
              Participant

                Thanks for the response.

                I’ve got the multilogin method to work…but after I pass the userid and password to groupwise I can’t get the window to refresh with the new account information. What do you think?

                Thanks for helping those who haven’t even purchased your GREAT software…yet!!

                Sincerely,

                Scott Caldwell

              Viewing 6 replies - 1 through 6 (of 6 total)