The User-Defined Values function enables SAP Business One users to enter values, originated by a predefined search process, for any field in the system (including user-defined fields). This function enables the user to enter data more efficiently and – perhaps most importantly – more accurately. In fact, the concept is sort of a "Workflow Light" implementation. It can both save user time and reduce data double entries.
In this article by Gordon Du, author of Mastering SQL Queries for SAP Business One, we will see how to work with User-Defined Values.Read Working with User Defined Values in SAP Business One in full
In this article by Sherry Li, author of MDX with Microsoft SQL Server 2012 Analysis Services Cookbook we will cover:
- Calculating the YTD (Year-To-Date) value
- Calculating the YoY (Year-over-Year) growth (parallel periods)
- Calculating moving averages
In the previous part of the article, we had a look at the Report Builder overview and described the Report Builder 2.0 interface. In this part by Jayaram Krishnaswamy, we will discuss about Enabling and reviewing My Reports, and will see how to Modify a basic report.Read Working with the Report Builder in Microsoft SQL Server 2008: Part 2 in full
Report Builder 2.0 is feature-rich reporting tool with the latest Microsoft Office look and feel. In this two part article by Jayaram Krishnaswamy, we will see how the Report Builder 2.0 provides an extremely flexible GUI with user friendly wizards for creating the Tablix data regions, a versatile construct that includes tables, matrix, and charts and gauges. Report Builder 2.0 supports server resources such as shared Data Sources, works with SQL Server Data Sources and many third party products, and can directly open and edit server hosted reports. Report Builder together with Report Manager provides powerful support for building and managing a bewildering array of report types.Read Working with the Report Builder in Microsoft SQL Server 2008: Part 1 in full
- Which components are used in a Three.js scene
- What you can do with the THREE.Scene() object
- How geometries and meshes are related
- The difference between the orthographic camera and the perspective camera
We will start by looking at how you can create a scene and add objects.Read Working with the Basic Components That Make Up a Three.js Scene in full
This three part article series by Alfonso V. Romero, teaches you how to create and edit your first template in Roller, along with some basics about the Velocity template language, and how to create your first Roller theme from scratch. You'll also learn about Roller's model and data objects, and how to use these objects' properties, methods, and macros in a custom template to show data from your weblog.
Basically, in this article series you shall:
- Learn how to create and edit your first template
- Learn about the Velocity Template Language and how you can use it in your Roller templates
- Work with Roller's model and data objects to access your weblog's data from custom templates
- Create a Roller theme from scratch!
Database relationship is hard to maintain even for a mid-sized PHP/MySQL application, particularly, when multiple levels of relationships are involved because complicated SQL queries are needed. CakePHP offers a simple yet powerful feature called 'object relational mapping' or ORM to handle database relationships with ease.In CakePHP, relations between the database tables are defined through association—a way to represent the database table relationship inside CakePHP. Once the associations are defined in models according to the table relationships, we are ready to use its wonderful functionalities. Using CakePHP's ORM, we can save, retrieve, and delete related data into and from different database tables with simplicity, in a better way—no need to write complex SQL queries with multiple JOINs anymore!
In this article by Ahsanul Bari and Anupom Syam, we will have a deep look at various types of associations and their uses. In particular, the purpose of this article is to learn:
- How to figure out association types from database table relations
- How to define different types of associations in CakePHP models
- How to utilize the association for fetching related model data
- How to relate associated data while saving
In the previous part of the article by David Overton, we discussed E-mail, Calendar, and Contact functionality of SBS 2008. In this part, we will discuss File Management and Remote access to the server, network, and services functionality provided by SBS 2008.Read Working with SBS Services as a User: Part 2 in full
Your SBS 2008 server, network, computers, and users will now be configured for use. However, to get the business benefit, you will need to embed the use of the services and facilities into the user's psyche to enable them to benefit from it and use it.
In this two part article by David Overton, we will cover the following areas:
- E-mail, Calendar, and Contacts
- File Management
- Remote access to the server, network, and services
In this part, we will discuss E-mail, Calendar, and Contact functionality of SBS 2008.Read Working with SBS Services as a User: Part 1 in full
TortoiseSVN is a popular and easy-to-use Subversion client for Microsoft Windows. It is a Windows Shell extension, and is not limited to any particular IDE. TortoiseSVN is a free software which has been released under the GNU General Public License.
In this article by Lesley Harrison, author of TortoiseSVN 1.7, we shall learn about differences and changelists in TortoiseSVN 1.7Read Working with Revision Logs in TortoiseSVN in full
The first thing to grasp is that Rails is often referred to as opinionated software (see http://www.oreillynet.com/pub/a/network/2005/08/30/ruby-rails-david-heinemeier-hansson.html. It encapsulates an approach to web application development centered on good practice, emphasizing automation of common tasks and minimization of effort. Rails helps developers make good choices, and even removes the need to make choices where they are just distractions.Read Working with Rails – Setting up and connecting to a database in full
In the previous article, we covered setting up a new Rails application and connecting it to a database. In this article, we take this a little further and deal with ActiveRecord, Migrations, Models, the Scaffold, and demonstrate how to complete the Database with the required tables using migrationsRead Working with Rails – ActiveRecord, Migrations, Models, Scaffolding, and Database Completion in full
Forms in Dynamics AX represent the user interface and are mainly used for entering or modifying data. They are also used for running reports, executing user commands, validating data, and so on.
Normally, forms are created using the AOT by creating a form object and adding form controls such as tabs, tab pages, grids, groups, data fields, images, and others. Form behavior is controlled by its properties or the code in its member methods. The behavior and layout of form controls are also controlled by their properties and the code in their member methods. Although it is very rare, forms can also be created dynamically from the code.
In this aticle by Mindaugas Pociusco-author of Microsoft Dynamics AX 2012 Development Cookbook, we will look at:
- Creating a dialog
- Handling a dialog event
- Building a dynamic form
- Adding a form splitter
- Creating a modal form
Creating a dialog
Dialogs are a way to present users with a simple input form. They are commonly used for small user tasks, such as fi lling in report values, running batch jobs, presenting only the most important fi elds to the user when creating a new record, and so on. Dialogs are normally created from X++ code without storing actual layout in the AOT.
The application class Dialog is used to build dialogs. Other application classes, such as DialogField , DialogGroup , DialogTabPage , and others, are used to create dialog controls. A common way of using dialogs is within the RunBase framework classes, where user input is required.
In this example, we will demonstrate how to build a dialog from the code using the RunBase framework class . The dialog will contain customer table fi elds shown in different groups and tabs for creating a new record. There will be two tab pages, General and Details. The first page will have Customer account and Name input controls. The second page will be divided into two groups, Setup and Payment, with relevant fields inside each group. The actual record will not be created, as it is out of scope of this example. However, for demonstration purposes, the information specifi ed by the user will be displayed in the Infolog.
How to do it...
Carry out the following steps in order to complete this recipe:
- Open the AOT, and create a new class CustCreate with the following code:
- In order to test the dialog, run the class. The following form should appear with the General tab page open initially:
- Click on the Details tab page to see the following screen:
- Enter some information into the fi elds and click on OK. The results are displayed in the Infolog:
How it works...
First, we create a new class CustCreate. By extending it from RunBase, we utilize a standard approach of developing data manipulation functions in Dynamics AX. The RunBase class defines a common structure and automatically adds additional controls, such as OK and Cancel buttons to the dialog. Then we declare class member variables, which will be used later. Variables of the DialogField type represent user input fields. Other variables are used to store the actual user input.
The pack() and unpack() methods are normally used to convert an object to a container, which is a format to store an object in the user cache (SysLastValue) or to transfer it between Server and Client tiers. RunBase requires those two methods to be implemented in all its subclasses. In this example, we are not using any of the pack()/unpack() features, but because those methods are mandatory, we return an empty container from pack() and true from unpack().
The layout of the actual dialog is constructed in the dialog() member method. Here, we define local variables for the dialog itself—tab pages and groups. Those variables, as opposed to the dialog fields, do not store any value for further processing.
The super() of the RunBase framework creates the initial dialog object for us. The object is created using the Dialog application class. The class actually uses an AOT form named Dialog as a base, as a base, automatically adds the relevant controls, including OK and Cancel buttons, and presents it to the user as a dialog.
Additional controls are added to the dialog by using the addField(), addGroup(), and addTabPage() methods. There are more methods to add different types of controls, such as addText(), addImage(), addMenuItemButton(), and others. All controls have to be added to the dialog object directly. Adding an input control to groups or tabs is done by calling addField() right after addGroup() or addTabPage(). In the previous example, we added tab pages, groups, and fields in logical sequence top down. Notice that it is enough only to add a second tab page, the first one labeled General is added automatically by the RunBase framework.
Values from the dialog controls are assigned to variables by calling the value() member method of DialogField class. If a dialog is used within the RunBase framework, as in this example, the best place to assign dialog control values to variables is the getFormDialog() member method. RunBase calls this method right after the user clicks OK.
The main processing is done in the run() method. For demonstration purposes, this class only shows the user input the Infolog.
In order to make this class runnable, the static method main() has to be created. Here, we create a new CustCreate object, invoke user dialog by calling the prompt() method, and once the user finishes entering customer details by clicking OK, we call the run() method to process the data.
Handling a dialog event
Sometimes in the user interface, it is required to change the status of one field, depending on the status of another field. For example, if the user marks the Show filter checkbox, then another field, Filter, appears or becomes enabled. In AOT forms, this can be done using input control modified() event. However, if this feature is required on runtime dialogs, handling events are not that straightforward.
Very often, existing dialogs have to be modified to support eventing. The easiest way of doing that is of course to convert a dialog into an AOT form. However, in cases when the existing dialog is complex enough, probably a more cost effective solution would be to implement dialog event handling instead of converting it into an AOT form. Event handling in dialogs is not as flexible as in AOT forms, but in most cases it does the job.
In this recipe, we will create a dialog very similar to the previous one, but instead of entering the customer number, we will be able to select it from the list. Once the customer is selected, the rest of the fields will be completed automatically by the system from the customer record.
How to do it...
Carry out the following steps in order to complete this recipe:
How it works...
The new class CustSelect is actually a copy of the CustCreate class from the previous recipe with a few changes. In its class declaration, we leave all DialogField declarations and remove the rest of the variables.
The methods pack()/unpack() remain the same as we are not using any of their features. In the dialog() member method, we call the allowUpdateOnSelectCtrl() method with the argument true to enable input control event handling. We also disable all controls apart from the Customer account by calling enable() with parameter false for each control. The member method dialogSelectCtrl() of the RunBase class is called every time the user modifies any input control in the dialog. It is the place where we have to add all the required code to ensure that, in our case, all controls are populated with the correct data from the customer record, once the Customer account is chosen.
The static main() method ensures that we can run this class.
Usage of the dialogSelectCtrl() method sometimes might appear a bit limited as this method is only invoked when the dialog control loses its focus. Also, no other events can be controlled, and it can become messy if events on multiple controls need to be processed.
The Dialog class does not provide direct access to the underlying form's event handling functions, but we can easily access the form object within the dialog. Although we cannot create the usual event handling methods on runtime form controls, we can still control this in a slightly different way. Let us modify the previous example to include more events. We will add an event on the second tab page, which is triggered once the page is activated.
First, we have to override the dialogPostRun() method on the CustSelect class:
Here, we enable event overloading on the runtime form after it is fully created and is ready for displaying on the screen. We also pass the CustSelect object as an argument to the controlMethodOverloadObject() method to make sure that the form knows where the overloaded events are located.
Next, we have to create a method that will be executed once the tab page is opened:
The method name consists of the control name and event name joined with an underscore. Now run the class again, and select the Details tab page. The message should be displayed in the Infolog.
Before creating such methods, we first have to get the name of the runtime control. This is because the dialog form is created dynamically, and the system defines control names automatically without allowing the user to choose them. In this example, we have to temporarily add the following code to the bottom of the dialog(), which displays the name of the Details tab page control. Just replace the following code:
With the following code:
Running the class would display the name of the control in the Infolog.
Note that this approach may not work properly if the dialog contains an automatically-generated query. In such cases, control names will change if the user adds or removes query ranges.
This article by Erlend Dalen, explains how you can use .NET classes in AX with the Common Language Runtime and how you can write .NET code that uses AX classes by using the .NET Business Connector for AX.
The topics covered in this article are:
- A brief description of Common Language Runtime (CLR)
- Adding .NET references to classes in AX
- Using a .NET class in X++
- Adding references to the .NET Business Connector
- Using the .NET Business Connector in .NET classes
Master pages are a very important part of any large-scale site. They allow you to easily manage the boilerplate code that every page in your site uses. This might encompass features such as navigational items, header and footer layout, basic layout, and so on. In this article by Andrew Siemer and Richard Kimber, authors of ASP.NET MVC 2 Cookbook, we will discuss how to create and use master pages to control application-wide formatting. We will also take a look at how to employ a base page, to control which master page is used. Then we will see how to pass data from the view to the master page. Specifically we will cover:
- How to create a master page
- Determining the master page in the ActionResult
- Controlling which master page is used with a view base class
- Setting the master page from a controller base class
- Passing data to the master page
This article by Christophe Muller, from the book Instant Mercurial SCM Essential How-to, explains how to work with local files, either personal projects or files you wish to be version controlled (for example, source code or configuration files). You will learn how to create a new repository, make changes, and track them (selecting files to track, recording changes, and reversing those changes).Read Working with local files (Simple) in full
In this article, by Vijay Joshi, author of PHP jQuery Cookbook, we will cover:
- Creating JSON in PHP
- Reading JSON in PHP
- Catching JSON parsing errors
- Accessing data from a JSON in jQuery
In this article series by Marcus Hirt and Marcus Lagergren, authors of Oracle JRockit: The Definitive Guide, you will learn:
- How to hunt down latency-related problems
- How to detect indications of a memory leak in an application
- How to use the operative set in the JRA latency analyzer component
In the earlier part of this article series —Working with JRockit Runtime Analyzer- A Sequel, we have covered the following:
- Different ways to create a JRA recording
- How to find the hot spots in your application
- How to interpret memory-related information in JRA