Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Nếu bạn đặt các thông số với nhau cho một truy vấn REST ItemSearch, đây là một ví dụ về những gì bạn có thể có. Phần còn lại truy vấn được đặt trong một biến PHP được gọi là $ theURL, | CHAPTER 3 USING DATA MACROS Exploring the Macro Editor You ll be creating several more data macros but before you do that I want to explain some of the features of the Macro Editor. As you ve noticed you don t write code instead you design a macro by adding actions and filling in the appropriate parameters. The Action Catalog shown in Figure 3-9 provides a good overview of the available actions. Figure 3-9. The Action Catalog There are three types of actions Program Flow Data Blocks and Data Actions. The Comment action which you have already used simply adds a line of text to explain something about the macro. You ll use the Group and If actions later. The Group action allows you put a set of actions in a group which can then be collapsed. This is roughly equivalent to the region blocks in .NET code. The If action lets you add conditional logic in your macro. Understanding Data Blocks Accessing and updating data is always done inside a data block. When you add a data block action to a macro the editor indents the block and highlights that area of the macro. It does this to help you keep track of the scope of that block. 58 CHAPTER 3 USING DATA MACROS For example you used an EditRecord action which is a data block action. You then added a SetField action to update a specific field of that record. The EditRecord action defines the record that is to be updated. The SetField action has to be inside the scope of the EditRecord action. If you were to place them outside of that scope the Macro Editor would not know which record to update. The LookupRecord action works the same way. It looks up a single record. You can only access fields from that record while inside the scope of that data block. Likewise you can only edit that record while inside that data block. That s why the EditRecord action is inside the scope of the LookupRecord action. There are two other data block actions. The CreateRecord is used when you want to insert a new record. You add SetField actions .