Join Gini von Courter for an in-depth discussion in this video Understanding web macros, part of Creating Access Web Apps in SharePoint 2013.
- View Offline
- There are two different types of macros that we can create for our web apps. Actually two different command sets that operate in two totally different domains. The first type of macro is what's called a Web macro. And these use the commands that would be available if we were creating a database and automating it on our desktop. But the commands that don't work in a browser but do on a desktop have been removed. So we have a browser friendly set of macro commands that you may already be somewhat familiar with.
The second set of macros, or the second type are called Data macros. And these macros run in the database itself. They run in SQL Server. And we'll be talking about those a little later in this section. But right now we're gong to focus on the Web macros. Web macros are focused on user interface. They're used to modify the UI. For example, to display a control that was previously hidden. Or to change from one view to another. They're also used to automate tasks.
And Web macros can interact with your user. So you can use a Web macro to pop up a message box and provide additional information. They are triggered by events three different ways. First, events that are View events. On load. On current, or Control events. On click or after update. And we'll access those through the actions command that is available for the view and for controls. But we can also have stand alone Web macros that are triggered by a user event.
So a user decides, "Oh, I'd like to run that code now". And they click a button to do that. There are two other type of macros that are beyond the scope of this course but I'd still like to describe them to you because you'll see the command to create them. The first is an On Start macro. And the On Start macro runs just before your web app launches. A typical use of those is for default settings that you don't want to have to change in specific tables in your app.
Or don't want to have to change in drop down lists. But there are other uses for the On Start macro as well. And if you have worked with an Access desktop database and when it launches, a form opens every time. That is a dashboard or a control panel. Then that macro is running in the On Start event of that database. The fourth type of macro is called On Deploy. And it's actually used if you want to take your web app and be able to deploy it on other servers.
Perhaps you're creating a web app that's going to be used commercially. Or will be used on different servers in your organization. And so you can think of this as part of your installation package. Part of the way that you're going to distribute this macro. So, Web macros, Data macros, On Start macros, which are a type of Web macro, and On Deploy macros. That's the entire field. In the next movie, we'll create our first Web macro.
- Creating a new app
- Building tables from different sources
- Creating relationships between tables
- Working with views
- Using macros for automation
- Saving your app in an app package