Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2013 Web Apps - Email Reminders

Status
Not open for further replies.

Argonto

Technical User
Mar 17, 2011
23
US
Hi,
I am working on a new Project Tracking system for my office. I am using Access 2013 and Sharepoint 2013 to design and publish the Web App.
Currently I am able to send out changelog emails using the After Insert funtion on my log table.

My next big issue is going to be setting up a reminder email. I would like to send a reminder to the Lead Tech or the Second Tech on a specified date. However I am not sure how to do this.

Do Access Web Apps run macros when no users are active?
Is there a way to have Macros run at a specific time each day?

Currently I am using this code to send out change updates.
SendEmail_bqke5f.png


In the end my goal is to have assigned users notified when a change is made, when the date matches the date set for the reminder and when a delayed event becomes active.

Thanks!



Project_Window_tvtfsn.png
 
Here is the actual code, since the screenshot is so small.

Code:
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<DataMacros xmlns="[URL unfurl="true"]http://schemas.microsoft.com/office/accessservices/2010/12/application"><DataMacro[/URL] Event="AfterInsert"><Statements><LookUpRecord><Data><Reference>Projects</Reference><WhereCondition><Expression><Original>[Projects].[ID]=[ProjectHistory].[ProjectID]</Original><FunctionCall Name="="><Identifier Name="Projects.ID" Index="0"/><Identifier Name="ProjectHistory.ProjectID" Index="1"/></FunctionCall></Expression></WhereCondition></Data><Statements><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">varprojectname</Argument><ExpressionArgument Name="Value"><Expression><Original>[Projects].[Project Name]</Original><Identifier Name="Projects.Project Name"/></Expression></ExpressionArgument></Action><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">varprojectlead</Argument><ExpressionArgument Name="Value"><Expression><Original>[Projects].[Lead]</Original><Identifier Name="Projects.Lead"/></Expression></ExpressionArgument></Action><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">varprojectsecond</Argument><ExpressionArgument Name="Value"><Expression><Original>[Projects].[Second]</Original><Identifier Name="Projects.Second"/></Expression></ExpressionArgument></Action><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">varprojectsleadalerts</Argument><ExpressionArgument Name="Value"><Expression><Original>[Projects].[Lead Alerts]</Original><Identifier Name="Projects.Lead Alerts"/></Expression></ExpressionArgument></Action><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">varprojectssecondalerts</Argument><ExpressionArgument Name="Value"><Expression><Original>[Projects].[Second Alerts]</Original><Identifier Name="Projects.Second Alerts"/></Expression></ExpressionArgument></Action></Statements></LookUpRecord><LookUpRecord><Data><Reference>Employees</Reference><WhereCondition><Expression><Original>[Employees].[ID]=[varprojectlead]</Original><FunctionCall Name="="><Identifier Name="Employees.ID" Index="0"/><Identifier Name="varprojectlead" Index="1"/></FunctionCall></Expression></WhereCondition></Data><Statements><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">varleademail</Argument><ExpressionArgument Name="Value"><Expression><Original>[Employees].[Email]</Original><Identifier Name="Employees.Email"/></Expression></ExpressionArgument></Action></Statements></LookUpRecord><LookUpRecord><Data><Reference>Employees</Reference><WhereCondition><Expression><Original>[Employees].[ID]=[varprojectsecond]</Original><FunctionCall Name="="><Identifier Name="Employees.ID" Index="0"/><Identifier Name="varprojectsecond" Index="1"/></FunctionCall></Expression></WhereCondition></Data><Statements><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">varsecondemail</Argument><ExpressionArgument Name="Value"><Expression><Original>[Employees].[Email]</Original><Identifier Name="Employees.Email"/></Expression></ExpressionArgument></Action></Statements></LookUpRecord><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">varevent</Argument><ExpressionArgument Name="Value"><Expression><Original>[ProjectHistory].[Event]</Original><Identifier Name="ProjectHistory.Event"/></Expression></ExpressionArgument></Action><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">varchangetime</Argument><ExpressionArgument Name="Value"><Expression><Original>[ProjectHistory].[CreatedDate]</Original><Identifier Name="ProjectHistory.CreatedDate"/></Expression></ExpressionArgument></Action><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">varoldvalue</Argument><ExpressionArgument Name="Value"><Expression><Original>[ProjectHistory].[Old Value]</Original><Identifier Name="ProjectHistory.Old Value"/></Expression></ExpressionArgument></Action><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">varnewvalue</Argument><ExpressionArgument Name="Value"><Expression><Original>[ProjectHistory].[New Value]</Original><Identifier Name="ProjectHistory.New Value"/></Expression></ExpressionArgument></Action><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">vartitle</Argument><ExpressionArgument Name="Value"><Expression><Original>Concat('&lt;h2 style="font-weight: bold; font-size: 14px;"&gt;',"Change notification for Project Name: ",[varprojectname],'&lt;/h2&gt;&lt;br&gt;')</Original><FunctionCall Name="Concat"><StringLiteral Value="&lt;h2 style=&quot;font-weight: bold; font-size: 14px;&quot;&gt;" Index="0"/><StringLiteral Value="Change notification for Project Name: " Index="1"/><Identifier Name="varprojectname" Index="2"/><StringLiteral Value="&lt;/h2&gt;&lt;br&gt;" Index="3"/></FunctionCall></Expression></ExpressionArgument></Action><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">varmessage</Argument><ExpressionArgument Name="Value"><Expression><Original>Concat('&lt;h2 style="font-weight: bold; font-size: 12px;"&gt;',"Time of change: ",[varchangetime],'&lt;br&gt;',"Event: ",[varevent],'&lt;br&gt;',"Old Value: ",[varoldvalue],'&lt;br&gt;',"New Value: ",[varnewvalue],'&lt;br&gt;&lt;/h2&gt;')</Original><FunctionCall Name="Concat"><StringLiteral Value="&lt;h2 style=&quot;font-weight: bold; font-size: 12px;&quot;&gt;" Index="0"/><StringLiteral Value="Time of change: " Index="1"/><Identifier Name="varchangetime" Index="2"/><StringLiteral Value="&lt;br&gt;" Index="3"/><StringLiteral Value="Event: " Index="4"/><Identifier Name="varevent" Index="5"/><StringLiteral Value="&lt;br&gt;" Index="6"/><StringLiteral Value="Old Value: " Index="7"/><Identifier Name="varoldvalue" Index="8"/><StringLiteral Value="&lt;br&gt;" Index="9"/><StringLiteral Value="New Value: " Index="10"/><Identifier Name="varnewvalue" Index="11"/><StringLiteral Value="&lt;br&gt;&lt;/h2&gt;" Index="12"/></FunctionCall></Expression></ExpressionArgument></Action><Action Collapsed="true" Name="SetLocalVar"><Argument Name="Name">varsubject</Argument><ExpressionArgument Name="Value"><Expression><Original>"Change Notification: "+[varprojectname]</Original><FunctionCall Name="+"><StringLiteral Value="Change Notification: " Index="0"/><Identifier Name="varprojectname" Index="1"/></FunctionCall></Expression></ExpressionArgument></Action><ConditionalBlock><If><Condition><Expression><Original>[varprojectsleadalerts]=Yes</Original><FunctionCall Name="="><Identifier Name="varprojectsleadalerts" Index="0"/><BitLiteral Value="1" Index="1"/></FunctionCall></Expression></Condition><Statements><Action Collapsed="true" Name="SendEmail"><ExpressionArgument Name="To"><Expression><Original>=[varleademail]</Original><Identifier Name="varleademail"/></Expression></ExpressionArgument><ExpressionArgument Name="Subject"><Expression><Original>=[varsubject]</Original><Identifier Name="varsubject"/></Expression></ExpressionArgument><ExpressionArgument Name="Body"><Expression><Original>=Concat([vartitle],[varmessage])</Original><FunctionCall Name="Concat"><Identifier Name="vartitle" Index="0"/><Identifier Name="varmessage" Index="1"/></FunctionCall></Expression></ExpressionArgument></Action></Statements></If></ConditionalBlock><ConditionalBlock><If><Condition><Expression><Original>[varprojectssecondalerts]=Yes</Original><FunctionCall Name="="><Identifier Name="varprojectssecondalerts" Index="0"/><BitLiteral Value="1" Index="1"/></FunctionCall></Expression></Condition><Statements><Action Collapsed="true" Name="SendEmail"><ExpressionArgument Name="To"><Expression><Original>=[varsecondemail]</Original><Identifier Name="varsecondemail"/></Expression></ExpressionArgument><ExpressionArgument Name="Subject"><Expression><Original>=[varsubject]</Original><Identifier Name="varsubject"/></Expression></ExpressionArgument><ExpressionArgument Name="Body"><Expression><Original>=Concat([vartitle],[varmessage])</Original><FunctionCall Name="Concat"><Identifier Name="vartitle" Index="0"/><Identifier Name="varmessage" Index="1"/></FunctionCall></Expression></ExpressionArgument></Action></Statements></If></ConditionalBlock></Statements></DataMacro></DataMacros>
 
Please use 'Preview' before posting.

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Hi Andrzejek,

Thank you for the critique. I will try to do that in the future.

Do you have much experience with Access Web Apps? Could you help me out with the questions below?

Do Access Web Apps run macros when no users are active?
Is there a way to have Macros run at a specific time each day?


Thanks,
Argonto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top