Dynamically add / remove events to a calendar in SharePoint 2016

Michael 31 Reputation points
2020-07-30T21:23:22.667+00:00

Hi experts,

We have two calendar lists, one is to keep each person's vacation schedule, the other one tells which area each person covers in a certain period.
The data in vacation calendar list is something like below,

Person | Vacation Start Date | Vacation End Date
Alice | 2020-01-01 | 2020-01-05
Alice | 2020-07-01 | 2020-07-05
Bob | 2020-07-03 | 2020-07-04
Bob | 2020-07-31 | 2020-08-04

The coverage area schedule list looks like this,
Person | Area | Start Date | End Date
Alice | Area 1 | 2020-06-01 | 2020-07-31
Alice | Area 2 | 2020-08-01 | 2020-08-31
Bob | Area 1 | 2020-06-30 | 2020-08-01

Now I need to create a calendar view to show the coverage person in each area, but if a person is on vacation, the calendar will show this person is out of office and he/she won't show as a coverage person. For example, on 2020-7-2, for Area 1, both Alice and Bob are covering Area 1, but Alice is on vacation, so the calendar should look like below,

                       2020-07-02

all day event: Alice (vacation)
Bob (Coverage)
...

Is this something can be done using JavaScript from client side only?

Thanks,
Michael

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,594 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Amos Wu-MSFT 4,051 Reputation points
    2020-07-31T08:34:05.147+00:00

    I think this is unachievable.SharePoint View show items in current list,you could not find other list item in current list view.

    If you mean create a new calendar list and insert new items to this calendar list according to the above two lists items,JavaScript could insert items to the new list,but when you add new items in the above two lists,JavaScript code will not execute automatically.This condition need event receiver(item added) to add items to the new list.

    0 comments No comments