• Skip to main content
  • Skip to primary sidebar

DayBack

The Calendar You've Been Waiting For

  • Calendar
    • For Salesforce
    • FileMaker Calendar
    • For Google Calendar
    • For Google Sheets
    • For Microsoft 365
    • For Basecamp
    • Field Service
    • Integrations
  • Extensions
  • Pricing
  • Blog
  • Support
    • Support Options
    • Documentation
    • Documentation for DayBack Classic (older)
    • Implementation Packages
  • Contact
    • Our Mission
    • Team & Community
    • Careers
    • Contact Us
    • +1 (855) 733-3263
  • Timelines
    • Overview
    • History of the polio vaccine
    • Women’s Suffrage
    • Science Fiction
    • Your Vote in Context: the 2020 US Elections
    • History of Claris FileMaker
  • Sign In

May 10 2022

Edit Multiple Events at Once

Batch Editing in DayBack Calendar

In April we showcased KC’s great new app action that lets you click and drag to select multiple events. This made it much more convenient to select and drag events between resources, or back and forward through time. The one thing that has been missing was the ability to change the status, modify other event information, or trigger a custom function for all of the selected events.

Today we’d love to show you how you can extend our custom button launcher to add a series of buttons that can modify a collection of selected events. Here’s a video that shows you how we can use the button launcher to set up functions that change the status of all selected events.

How to Modify this Action

This action was built by extending our custom button launcher with a new function. The function:

  1. Checks to see if there are multiple events selected by checking the number of items in the multiSelect object seedcodeCalendar.get(‘multiSelect’);  
  2. It prompts you to confirm changes or gives you an error if no events are selected
  3. It then runs the updateEvents() function and passes a list of changes that should be made to the editEvent object of each of the selected events

You can easily modify this to update any field for an event, or you can loop through the multiSelect array, and run a FileMaker script or Salesforce trigger on each of the events. Because this function was built on top of the existing button launcher, you have the benefit of:

  1. Restricting a function to a specific user or list of users
  2. Restricting the function to specific views

Check out the custom button launcher for the full list of available features.

How to Configure a Multi-Update Button

Here’s an example of a single entry in the buttonList array. You can define the label, set the icon and color, and define the function that should run when the button is clicked. In this action, we define a list of event changes and pass it to the confirmEventChanges() function. This is simply a collection of fields that should be updated in the editEvent object. Click here to see the full list of editible fields.

inputs.buttonList = [        
    {
        'label': 'Set Status: Done',
        'icon': 'fa-check',
        'color': '#3164d2',
        'action': function() { 
            
            let eventChanges = {
                status: ['Done']
            };

            return confirmEventChanges(eventChanges); 
        },
    }
];

The confirmEventChanges() function prompts you with a modal and if confirmed, runs the updateEvent() function which simply applies the changes to the list of events.

function confirmEventChanges(eventChanges) {
            
            var multiSelect = seedcodeCalendar.get("multiSelect");
            var itemCount   = multiSelect !== undefined ? Object.keys(multiSelect).length : 0;

            if (itemCount > 0) {
                utilities.showModal(
                    "Confirm Changes", 
                    "Please confirm you want to update " + itemCount + " events",
                    'Cancel', 
                    function() {}, 
                    'Confirm', 
                    function() { updateEvents(multiSelect, eventChanges); }
                );
            } else {
                helpers.showMessage("Please select one or more events", 0, 3000);
            }        
        }

We hope this gives you some ideas on how to use the multiSelect object and button launcher together to extend DayBack. To download the code for this app action, check out this link to our extensions library:

Download Instructions

Written by Michael Dabrowski · Categorized: Dev · Tagged: Custom Actions, Resource scheduling

Reader Interactions

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Search

Latest Posts

  • Print Your Calendar at a Custom Size
  • Edit Multiple Events at Once
  • Focus Your Calendar on the Start of Your Week, Month, or Quarter
  • Drag-Select to Reschedule Multiple Events at Once
  • Improved Calendar Analytics – Targets & Goals

  • Facebook
  • Instagram
  • LinkedIn
  • Twitter
  • Vimeo

© SeedCode, Inc. 2013–2022
+1 (855) 733-3263
who shot this?

X

View Details
Keep me informed
Which calendar sources interest you?
Interested in a calendar source we haven't listed? Have a question for us? Please let us know.