Logo di Business Hours And Holidays

Business Hours And Holidays

Community
PranavNagrecha
business-hours-and-holidays

Use this skill when creating, deploying, or troubleshooting Salesforce Business Hours and Holidays: the calendars that pause Case escalation rules, entitlement milestones, and Apex BusinessHours math outside working hours. Covers the BusinessHoursSettings metadata, the default calendar, per-region calendars, holiday attachment, the Case Business Hours field, and the BusinessHours Apex class. Trigger keywords: business hours, holidays, SLA clock, escalation not pausing, working hours, support hours, milestone timer weekend. NOT for the escalation rule entries themselves — use admin/escalation-rules. NOT for entitlement process design — use admin/entitlements-and-milestones. NOT for Field Service operating hours or shift scheduling — use admin/fsl-scheduling-setup.

Add to TypingMind

Panoramica

Pubblicato daPranavNagrecha
RepositoryAwesomeSalesforceSkills
Nome della skillbusiness-hours-and-holidays
Stelle
26
Fork
5
File inclusi
7
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 7

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da PranavNagrecha su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Business Hours And Holidays in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/PranavNagrecha/AwesomeSalesforceSkills/tree/main/skills/admin/business-hours-and-holidays
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/PranavNagrecha/AwesomeSalesforceSkills.git /tmp/AwesomeSalesforceSkills
mkdir -p .claude/skills
cp -r /tmp/AwesomeSalesforceSkills/skills/admin/business-hours-and-holidays .claude/skills/business-hours-and-holidays
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Business Hours And Holidays in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Business Hours And Holidays non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Business Hours And Holidays non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Business Hours and Holidays

Activates when an SLA clock has to stop outside working hours. A business-hours calendar is the only thing that makes escalation rules, milestones, and BusinessHours Apex methods count working time instead of wall-clock time, and a holiday only counts once it is attached to a calendar.


Before Starting

  • Which calendar is the org default? Setup ships with a default calendar that is 24 hours, 7 days. Every consumer that is not told otherwise reads it, so an org that "has business hours" but never edited the default is still running SLAs round the clock.
  • Who reads the calendar? Escalation rule entries choose None, the Case's calendar, or a named calendar. Entitlement processes read the process-level calendar or a milestone-level override. Apex reads whichever Id you pass. Omni-Channel and approval processes read no calendar at all.
  • How does a Case get its calendar? Case.BusinessHoursId is empty unless something sets it. Empty means the default calendar for every consumer that says "use the Case's hours".
  • Time zone per calendar. Each calendar carries its own time zone; the daily windows are stored in that zone.

Questions to Ask Before Configuring

Ask these before touching Setup; the answers decide the design, and an LLM that skips them produces a calendar that looks right and pauses nothing.

AskWhy it mattersWhat a good answer adds
"Which SLA promise are we making, and to whom: one business day, four working hours, calendar hours?"Fixes whether business time is needed at all and which consumers must read itThe consumer map: escalation entries, milestones, Apex
"Which regions or teams work different hours or observe different holidays?"Each distinct answer is a calendarThe calendar list, each with a time zone and holiday set
"How do we know a Case's region at creation?"Decides the Case.BusinessHoursId rule; if unknowable at creation, the design falls back to the defaultThe before-save Flow logic and its fallback
"Is there any Case type that must be worked round the clock?"Those escalation entries use businessHoursSource = None on purposeDocumented exceptions instead of accidental 24/7
"Who maintains next year's holidays, and when?"Holidays expire; unmaintained calendars silently stop pausingAn owner and a yearly deploy in the release calendar
"Do reports or code need elapsed working time?"Formulas cannot compute it; Apex diff canA decision to build (or not build) the Apex helper

What a proper configuration adds over "just creating business hours": the SLA clock actually stops on weekends and holidays per region, escalation and milestone targets agree with each other, and the yearly holiday update is a reviewed deploy rather than a forgotten Setup task.


Core Concepts

The calendar record

A calendar is a BusinessHours record: name, active flag, default flag, time zone, and a start and end time for each weekday. All users can read BusinessHours through the API even without setup permissions, which is why Apex and Flow can look one up freely. Exactly one calendar is the org default. The Object Reference states the escalation consequence directly: "Escalation rules are run only during these hours", and holidays associated with the calendar suspend both the hours and the escalation rules that use them.

FieldMeaning
NameReferenced by name in escalation rule metadata (businessHours) and in settings
IsActiveInactive calendars cannot be selected by new consumers
IsDefaultThe org default; only one
TimeZoneSidKeyZone the day windows are expressed in
MondayStartTime … SundayEndTimeWindow per weekday; a day with no window is closed

Deployable metadata: one settings file

All calendars and holidays live in one file, settings/BusinessHours.settings-meta.xml, deployed as Settings with member BusinessHours (API 29.0+). Each businessHours entry carries name, active, default, timeZoneId, and the fourteen day-window fields in HH:mm:ss.SSSZ. Each holidays entry carries name, description, isRecurring, activityDate (non-recurring), recurrenceStartDate / recurrenceEndDate (recurring), and startTime / endTime, which are both null for a whole-day holiday. The full example is in references/examples.md; a second, single-region scenario with a genuine weekend-only calendar and full Metadata API field grounding is in references/metadata-examples.md.

Holidays are inert until attached

A holiday record does nothing by itself. It suspends time only for the calendars it is attached to, and a holiday can be attached to several calendars. "We added the holiday" with no attachment is the single most common reason a clock kept running on a public holiday.

Apex BusinessHours methods

All static, all take the calendar Id as a String; intervals are milliseconds.

MethodReturns
add(bhId, start, ms)Datetime reached after ms of business time from start, in the local time zone
addGmt(bhId, start, ms)Same, returned in GMT
diff(bhId, start, end)Business milliseconds between two datetimes
isWithin(bhId, target)true if target falls in business hours; holidays are included in the check
nextStartDate(bhId, target)Next datetime the calendar is open, or target itself if already open

Common Patterns

Pattern: Regional calendars selected at Case creation

When to use: Support teams in more than one region, one SLA policy, weekends and public holidays differ per region.

How it works:

  1. Create one calendar per region (time zone, windows) and attach that region's holidays to it.
  2. Keep the org default as the fallback region, not 24/7.
  3. Add a before-save record-triggered Flow on Case that sets BusinessHoursId from the account's region, the Case origin, or the entitlement. The Flow runs before the assignment rule and before any escalation timer starts.
  4. Point escalation entries at businessHoursSource = Case and milestones at the process default, so every consumer follows the Case's own calendar.

Why not one calendar: one calendar means every region's SLA pauses on one region's weekend and holidays.

Pattern: Working-time age in Apex or a formula-backed field

When to use: Reports need "business hours open" or a trigger needs to act after N working hours.

How it works: BusinessHours.diff(c.BusinessHoursId, c.CreatedDate, Datetime.now()) returns milliseconds of business time; divide by 3,600,000 for hours. Fall back to the default calendar when BusinessHoursId is null: [SELECT Id FROM BusinessHours WHERE IsDefault = true]. Formula fields cannot call the class, so write the result to a number field from a scheduled Flow or Apex.


Decision Guidance

SituationRecommended ApproachReason
Single support team, one time zoneEdit the default calendar; attach holidays to itEvery consumer already reads the default
Several regions with different holidaysOne calendar per region; set Case.BusinessHoursId at creationEscalation and milestones can follow the Case's calendar
One escalation entry must ignore hours (Sev-1)businessHoursSource = None on that entryEntry-level choice beats a per-Case calendar
SLA defined by contract tier, not regionCalendar at entitlement-process or milestone levelMilestones read the process calendar, not the Case field
Need "hours open" on a reportApex diff written to a fieldNo formula access to business time

Recommended Workflow

  1. Inventory consumers — list every escalation entry (businessHoursSource), entitlement process, milestone override, and Apex call that reads a calendar; the agent /configure-business-hours does this as a referenced-by inventory
  2. Design calendars — one per distinct time zone plus holiday set; decide which is the org default and whether the shipped 24/7 default is acceptable
  3. Attach holidays — every holiday to every calendar it applies to; check the coming twelve months
  4. Set the Case calendar — a before-save Flow populates BusinessHoursId; document the rule and the fallback
  5. Deploy — retrieve Settings:BusinessHours first, edit, deploy the whole file; run scripts/check_business_hours_and_holidays.py on it
  6. Test with a clock — create a Case just before closing time and confirm the escalation or milestone target date lands on the next open window (references/examples.md)

Review Checklist

  • The org default calendar is intentional, not the shipped 24/7 default
  • Every calendar has the correct time zone and a window for each working day
  • Every holiday is attached to at least one calendar and the next twelve months are covered
  • Case.BusinessHoursId is populated at creation or the fallback is documented
  • Each escalation entry's businessHoursSource (None / Case / Static) is the intended one
  • Entitlement process and milestone calendars are reviewed with the process owner
  • Apex callers handle a null BusinessHoursId
  • A test Case created after hours produced a target time in the next open window

Salesforce-Specific Gotchas

  1. The default calendar is 24/7 out of the box — an org that never edited it runs every SLA round the clock while believing it "has business hours".
  2. Unattached holidays do nothing — a holiday suspends time only for calendars it is attached to; the record's existence alone changes nothing.
  3. Escalation entries pick their own source — an entry set to Static with a named calendar ignores the Case's calendar, and one set to None ignores all calendars; a regional design that only sets Case.BusinessHoursId is defeated by entries left on None.

Deeper treatment in references/gotchas.md.


Output Artifacts

ArtifactDescription
settings/BusinessHours.settings-meta.xmlAll calendars and holidays, deployable as Settings:BusinessHours
Case calendar ruleBefore-save Flow logic that sets BusinessHoursId, with fallback
Consumer mapEscalation entries, milestones, Apex callers and the calendar each reads
Clock test recordEvidence that an after-hours Case escalated in the next open window

Reference Files

FileRead it when
references/metadata-examples.mdWriting the deployable XML for a single-region scenario with a genuine weekend-only calendar and a named 24/7 severity tier — field-by-field Metadata API grounding with line citations
references/examples.mdTwo regional calendars end to end, the Case-calendar Flow, the Apex working-time helper, and the clock test
references/gotchas.mdBefore deploying, and whenever an SLA clock keeps running when it should have paused
references/llm-anti-patterns.mdReviewing AI-generated business-hours guidance or metadata
references/well-architected.mdChoosing one calendar vs one per region, and citing the sources behind any claim in this skill

Related Skills

  • admin/escalation-rules — the entries that consume the calendar through businessHoursSource
  • admin/entitlements-and-milestones — process-level and milestone-level calendars
  • admin/case-management-setup — where Case.BusinessHoursId is set in the intake design
  • admin/assignment-rules — routing runs at save; the calendar only governs what happens afterwards
  • admin/omni-channel-routing-setup — a negative check: Omni-Channel availability has no calendar input
  • flow/record-triggered-flow-patterns — the before-save Flow that populates the Case calendar

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Business Hours And Holidays?

Use this skill when creating, deploying, or troubleshooting Salesforce Business Hours and Holidays: the calendars that pause Case escalation rules, entitlement milestones, and Apex BusinessHours math outside working hours. Covers the BusinessHoursSettings metadata, the default calendar, per-region calendars, holiday attachment, the Case Business Hours field, and the BusinessHours Apex class. Trigger keywords: business hours, holidays, SLA clock, escalation not pausing, working hours, support hours, milestone timer weekend. NOT for the escalation rule entries themselves — use admin/escalatio...

Perché usare Business Hours And Holidays su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Business Hours And Holidays è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Business Hours And Holidays in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/PranavNagrecha/AwesomeSalesforceSkills/tree/main/skills/admin/business-hours-and-holidays. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Business Hours And Holidays?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Business Hours And Holidays?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Business Hours And Holidays: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Business Hours And Holidays è gratuita?

È pubblicata su GitHub da PranavNagrecha. Consulta il repository per i termini di licenza. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇