HOW TO USE D4E SCHEDULER WITH SERVERS AND MOBILE DEVICES

Step 2. Set up all Client PCs with D4E add-in only.

On the client PC- you only need to have Excel and D4E add-in. ODBC drivers and database connections are not required!  The client PC Excel/D4E setup will submit D4E commands/scripts to the server PC, so that execution will happen in the server.  After completion, the server PC will simply send the results back to the client PCs. This can save processing time, setup effort, and resources in the client PCs.  There can also be big productivity boosts and/or cost savings if direct database access is limited to a few restricted and/or expensive user licenses. To submit job requests to the server, the client PCs must use the Submit button (Thunderbolt icon) instead of the OK button, as below:

Step 1. Set up the Server PC with D4E.

On the server PC- install Excel, D4E, ODBC drivers, and all database connections as per normal.  Execute the command "StartScheduler" via a menu item, script command, or a macro command. This will hide the current instance of Excel and enter a continuous process of waiting for job requests from client PCs. The scheduler will appear as below.  Click on "less" for a smaller view.

D4E Scheduler Function Guide

The D4E Scheduler feature is designed to automate tasks within Excel, making it easier to manage recurring processes such as running SQL queries, sending and receiving emails, and more. The Scheduler enables business users to set up tasks that will run automatically on specified dates and times without any manual intervention.


The Scheduler also serves to power the back-end processes and act as a server to mobile devices (phones and thin laptops) that do not have direct database connections.  To create a server instance, start the Scheduler in the dedicated Excel D4E session with at least the following scheduled tasks:
getinbound user@domain,com (or @domain.com)  topic

sendoutbound


The dedicated server can then listen repeatedly (getinbound) and process requests (found as commands in the body of emails).   Any output results can be sent back to users (sendoutbound).  There can be many dedicated servers created as needed by users or by domains.

This guide explains the Scheduler functionality, detailing its process steps, features for servers and devices, the available scheduling commands, and the email lifecycle.

1. Scheduler Process Overview


The D4E Scheduler is responsible for automating tasks within Excel. These tasks can include:

Running SQL queries at scheduled intervals.

Email automation, including sending and receiving emails with specific content or attachments.

File management tasks, like adding data from external sources or removing outdated sheets.

Scheduler Process Steps

a. Define Task: The first step is to define the task you want to automate. This could include running an SQL query, sending an email, or performing any other automated Excel task.

b. Set Task Parameters: You can define specific parameters for the task, such as:

The time and date to start the task.

Any specific inputs or values needed for the task, such as file locations or email addresses.

c. Task Execution: The D4E Scheduler runs the defined tasks at the scheduled time, executing them without any further input needed from the user. For tasks like SQL execution, the results are automatically inserted into the Excel workbook.

d. Task Monitoring: You can monitor the status of scheduled tasks, including whether they have been completed successfully or encountered an issue.

e. Notification: After execution, you can opt to receive a notification, such as an email, confirming the completion or failure of the scheduled task.

2. Scheduler Features for Servers/Devices

The D4E Scheduler can be used with servers and devices, ensuring that tasks are performed consistently, even when you're not actively working in Excel.

Server Integration: For businesses with servers running Excel or D4E, you can schedule tasks on remote servers. The Scheduler will run tasks at the designated times, whether the user is actively using the server or not.

Device Usage: D4E Scheduler can be configured on individual workstations or devices, automating tasks on personal computers or business devices.

Automated Emails: The Scheduler can automate the sending of emails to a single recipient, a domain, or a distribution list. This feature is particularly useful for sending regular reports or data updates.

3. List of Commands for Scheduling


Here are the 4 main commands available for scheduling tasks within D4E:

1. ScheduleTask

Purpose: Schedules a task to run at a specified time or interval.


Format:

startscheduler - Start the scheduler.

or Click on menu command Start Scheduler

Example Usage: startscheduler

This starts scheduler and reads all tasks available for scheduling.

2. StopScheduler

Purpose: Stops the task scheduler if it’s running. You can use this command to pause or stop any scheduled tasks.


Format:

stopscheduler - Stop the scheduler.

or Click on menu command Stop Scheduler

Example Usage: StopScheduler

This stops any ongoing scheduled tasks.

3. Show Task Status

Purpose: Retrieves a list of all scheduled tasks and their status.


Format:  Click on menu command Show Task Status

Example Usage: ScheduleEmail "recipient@example.com", "Report Subject", "Report Body", "C:\path\to\file.xlsx", "2025-05-10 15:00"

This command displays all upcoming scheduled tasks and when they will execute next.

4. Validate Tasks

Purpose: Retrieves a list of all scheduled tasks and their status.


Format:  Click on menu command Validate Tasks

This command validates all tasks to check if they can be scheduled correctly.

4. Email Lifecycle in D4E Scheduler

D4E’s email automation feature integrates with the Scheduler to allow sending and receiving emails as part of an automated process. The email lifecycle includes inbound email handling, outbound email sending, and managing email folders (inbound, outbound, sent). Here's a breakdown of the lifecycle:

Email Lifecycle Steps

1. Get Inbound Emails:

The GetInbound command checks for any new emails in the INBOX email folder. It can be configured to process emails based on specific criteria (e.g., subject, sender).


Format:
getinbound <email|dom> <topickey> - Read commands from user@domain.com or @domain.com for topic

Command Example: GetInbound user@domain.com Finance2

Retrieves new emails to process.

2. Send Outbound Emails:

The SendOutbound command is used to send emails based on scheduled tasks. This command constructs and sends an email by reading a file (SENDFILExxx.TXT) that can include recipients, subject, body, and any attachments.  The files (SENDFILExxx.TXT) can be created using the command CreateSendFIle or CreateSendSheet.

Format:
createsendfile <email> <title> <file> <maxlines> - Prepare output results for sending by email.
createsendsheet <email> <title> <sheet> <+/- maxlines> - Prepare report sheet for sending by email.

sendoutbound - Send output results to email.

Command Example: SendOutbound

Sends an email with the provided content and attachment.



3. Outbound Folder:

The Outbound Folder (C:\TEMP\D4E\OUTBOUND\) is where emails are queued for sending. The Scheduler ensures that emails are automatically sent to the Outbound Folder for dispatch according to your schedule.

4. Sent Folder:

Once the email has been successfully sent, it is moved to the Sent Folder (C:\TEMP\D4E\SENT\) for tracking and auditing purposes.



Using $D4E$ in Email TITLE


A remote user must send an email with title beginning with $D4E$ topickey.  This indicates to D4E that this email is part of the back-end process.  topickey must match the topickey of a D4E process currently started and executing the task with the corresponding getinbound command.


Use these as titles for your email addressed to the back-end server to indicate that the Email Body contains command for the back-end process to execute.

Example: Email Title contains -    $D4E$  Finance2025

                Email Body contains -   updatedbfile

                Email Attachment includes -   updatefile.xlsx


Description: When this email is received, D4E will open the attachment and update the database table with rows from the .xslx file


5. Limiting Email Requests from Specific Remote Users

With the D4E Scheduler, you can filter email requests to come only from specific senders or sender domains.:

Single Email:

Get email requests on from a specific recipient.and userkey.

Example: GetInbound  user@example.com    topickey

Single Domain:

Send emails to all recipients within a specific domain (e.g., all emails ending with @example.com).

Example: GetInbound  @example.com    topickey/userkey

topickey or userkey can also be used for:
a) SECURITY/INTEGRITY - security code known only to valid users of the back-end process.

b) PERFORMANCE - the ability to create multiple server instances to process for a particular email user or domain group.



Summary of Scheduler Functionality

Automate Tasks: Schedule SQL queries, emails, and data management tasks to run automatically at specified times.

Email Automation and Back-Room Processing: Automate the process of sending and receiving emails, with the ability to handle inbound and outbound messages as part of the automated workflow.

Advanced Scheduling : The D4E Scheduler can manage tasks like sending emails to a single user, a domain, or all users based on your configuration.

Commands: Use commands like Start Scheduler, Stop Scheduler, and Show Task Status to manage your automated tasks effectively.

By using D4E’s Scheduler, business users can automate data workflows and ensure consistent, timely task execution without needing to manually trigger processes.

You can set up D4E in a server machine (or any stand-alone PC) dedicated to D4E database access. When a server machine is successfully able to access all databases using D4E apps, that machine can now be used to serve many client PCs and provide database results.  This reduces burden on the client PCs in terms of processing resources and connection activities.  More importantly, the client PCs do not even need ODBC drivers or credentials to access the databases.  It is only the server that will connect using its own credentials.  The client PCs only need to connect securely to the server using LAN profiles.

Conclusions


By using D4E servers, end-users can operate D4E in thin environments like standard PC configurations (SOE), Citrix installations, or browser-based ASP apps. By doing this, it is possible to have zero footprint; save on per-user database license costs; or boost productivity in environments with limited data access.