This topic contains 1 reply, has 2 voices, and was last updated by admin admin 1 week, 4 days ago.

  • Author
    Posts
  • #75546

    William Cole

    evaluating the calender

    I am looking to copy one event from one day to the next.

    How do I do that. I am not looking to create a repeating event.

    Didn’t find anything on your forum

  • #75549
    admin
    admin
    Keymaster

    Hi William.

    This can be achieved by editing your soSIMPLE Action Script.

    Scroll down to the section that starts with:

    Else If [ $event_type=”Edit” ] 

    Right after the “Find” step, test for whether your option/alt key is being held down. If it is, then duplicate the found record before proceeding. (our sample script defines $modifer at the top of the script). Your new snippet will look something like this:

    Else If [ $event_type=”Edit” ]

    #EDIT EVENT #

    # – User is editing the event by dragging it on the calendar

    # – Our example opens a new window off-screen, finds the event, and sets the fields to the dragged area closes the window.

    # – Since this an edit from the client-side calendar is just date, time and/or resource, you don’t need to confirm the change.

    #

    New Window [ Style: Document ; Name: “Event” ; Top: -3100 ; Left: -3100 ]

    Go to Layout [ $data_layout_name ; Animation: None ]

    Set Variable [ $toc ; Value: Get(LayoutTableName) & “::” ]

    Enter Find Mode [ Pause: Off ]

    Set Field By Name [ $toc & $event_id_field ; $event_id ]

    Set Error Capture [ On ]

    Perform Find []

    Set Error Capture [ Off ]

    #

    If [ $modifier = 8 or $modifier=16 ]

           Duplicate Record/Request

    End If

    Set Field By Name [ $toc & $date_start_field ; GetAsDate($from) ]

    Set Field By Name [ $toc & $date_end_field ; GetAsDate($to) ]

    Set Field By Name [ $toc & $time_start_field ; If ($untimed; GetAsTime(“”);GetAsTime($from)) ]

    Set Field By Name [ $toc & $time_end_field ; If ($untimed; GetAsTime(“”);GetAsTime($to)) ]

    Set Field By Name [ $toc & $event_unit_field ; $unit ]

    Set Field By Name [ $toc & $show_only_field ; 1 ]

    Set Field By Name [ $toc & $unscheduled_field ; $unscheduled_flag ]

    #

    # — sets id to refresh just that event in the calendar

    Set Variable [ $id ; Value: GetField ($toc & $event_id_field) ]

    Now, every time you drag an event on the calendar with the option or alt key held down, you’ll be duplicating the event.

    • This reply was modified 1 week, 4 days ago by admin admin.
    • This reply was modified 1 week, 4 days ago by admin admin.

You must be logged in to reply to this topic.