Software Development Kit (SDK) Development Utilities Guide

Similar documents
for Sage 100 ERP Business Insights Overview Document

Microsoft Access Basics

GP REPORTS VIEWER USER GUIDE

Using the Query Analyzer

2012 Teklynx Newco SAS, All rights reserved.

Richmond SupportDesk Web Reports Module For Richmond SupportDesk v6.72. User Guide

2009 Braton Groupe sarl, All rights reserved.

MICROSOFT OFFICE ACCESS NEW FEATURES

TheFinancialEdge. Fast! Guide

Uni Sales Analysis CRM Extension for Sage Accpac ERP 5.5

Avaya Network Configuration Manager User Guide

Sage 300 ERP Sage CRM 7.2 Integration Guide

Configuration Manager

Jet Data Manager 2012 User Guide

Sage 300 ERP Sage CRM 7.1 Integration Guide

How to Work with Crystal Reports in SAP Business One

HP Application Lifecycle Management

BID2WIN Workshop. Advanced Report Writing

Introduction to Microsoft Access 2003

Table and field properties Tables and fields also have properties that you can set to control their characteristics or behavior.

Microsoft Visual Studio Integration Guide

Microsoft Dynamics CRM Adapter for Microsoft Dynamics GP

Access 2007 Creating Forms Table of Contents

HP Quality Center. Software Version: Microsoft Word Add-in Guide

MAS 500 Intelligence Tips and Tricks Booklet Vol. 1

Results CRM 2012 User Manual

Microsoft Dynamics GP. Audit Trails

Forms Printer User Guide

HP Enterprise Integration module for SAP applications

Microsoft Access 2010 Part 1: Introduction to Access

How To Set Up Total Recall Web On A Microsoft Memorybook (For A Microtron)

Designing and Running Reports. Applicable to onwards

How To Use Query Console

Microsoft Dynamics GP Audit Trails

T300 Acumatica Customization Platform

Application Developer Guide

DbSchema Tutorial with Introduction in SQL Databases

ACCESS Importing and Exporting Data Files. Information Technology. MS Access 2007 Users Guide. IT Training & Development (818)

How to Work with SAP Crystal Reports in SAP Business One

Team Foundation Server 2012 Installation Guide

ORACLE USER PRODUCTIVITY KIT USAGE TRACKING ADMINISTRATION & REPORTING RELEASE 3.6 PART NO. E

Decision Support AITS University Administration. Web Intelligence Rich Client 4.1 User Guide

Developing Rich Web Applications with Oracle ADF and Oracle WebCenter Portal

PTC Integrity Eclipse and IBM Rational Development Platform Guide

Parameter Fields and Prompts. chapter

Using Adobe Dreamweaver CS4 (10.0)

USER GUIDE Appointment Manager

Sage ERP Accpac 6.0A. SageCRM 7.0 I Integration Guide

Scheduling Software User s Guide

Multicurrency Bank Reconciliation 9.0

Blackbaud, Inc. This publication, or any part thereof, may not be reproduced or transmitted in any form or by any means, electronic, or

Create a New Database in Access 2010

IBM Tivoli Software. Document Version 8. Maximo Asset Management Version 7.5 Releases. QBR (Ad Hoc) Reporting and Report Object Structures

ProperSync 1.3 User Manual. Rev 1.2

AR Collections Manager for Microsoft Dynamics SL

Crystal Reports Installation Guide

LANDESK Service Desk. Desktop Manager

Search help. More on Office.com: images templates

ICP Data Entry Module Training document. HHC Data Entry Module Training Document

Context-sensitive Help Guide

Microsoft Access 2010 Overview of Basics

Lesson 07: MS ACCESS - Handout. Introduction to database (30 mins)

Business Insight Report Authoring Getting Started Guide

Introduction to Microsoft Access 2013

DBMoto 6.5 Setup Guide for SQL Server Transactional Replications

Writer Guide. Chapter 15 Using Forms in Writer

Acclipse Document Manager

Creating a Database in Access

Contact Manager and Document Tracking. CampusVue Student User Guide

Microsoft Dynamics CRM 4.0 User s Guide

Appendix A How to create a data-sharing lab

Plug-In for Informatica Guide

DataPA OpenAnalytics End User Training

SAP Business Objects Business Intelligence platform Document Version: 4.1 Support Package Data Federation Administration Tool Guide

Sage ERP Accpac 6.0A. Installation and System Administrator's Guide

Aras Corporation Aras Corporation. All rights reserved. Notice of Rights. Notice of Liability

Silect Software s MP Author

How To Create A Powerpoint Intelligence Report In A Pivot Table In A Powerpoints.Com

Building A Very Simple Web Site

Tutorial: Mobile Business Object Development. SAP Mobile Platform 2.3 SP02

PORTAL ADMINISTRATION

QUICK START GUIDE RESOURCE MANAGERS. Last Updated: 04/27/2012

Data Tool Platform SQL Development Tools

Contents COMBO SCREEN FOR THEPATRON EDGE ONLINE...1 TICKET/EVENT BUNDLES...11 INDEX...71

Form And List. SuperUsers. Configuring Moderation & Feedback Management Setti. Troubleshooting: Feedback Doesn't Send

Microsoft Access 2003 Module 1

Sage Intelligence Financial Reporting for Sage ERP X3 Version 6.5 Installation Guide

Tutorial: Mobile Business Object Development. SAP Mobile Platform 2.3

Microsoft Access 2010 handout

Chapter 4 Accessing Data

Tutorial: Mobile Business Object Development. Sybase Unwired Platform 2.2 SP02

Introduction to Microsoft Access 2010

Creating Database Tables in Microsoft SQL Server

Building and Using Web Services With JDeveloper 11g

Sage 500 ERP (7.4) Business Intelligence

Rational Rational ClearQuest

EMC Documentum Webtop

StarWind iscsi SAN & NAS: Configuring HA Shared Storage for Scale- Out File Servers in Windows Server 2012 January 2013

Sage 100 ERP. Installation and System Administrator s Guide

SageCRM 6.1. What s New Guide

Transcription:

Software Development Kit (SDK) Development Utilities Guide Sage ERP MAS 500 ERP

Copyright 2000-2011 Sage Software, Inc. All rights reserved. Sage, Sage logos, and the Sage product and service names mentioned herein are registered trademarks or trademarks of Sage, Inc. or its affiliated entities. All other trademarks are the property of their respective owners.

Table of Contents Chapter 1: Development Utilities... 1 Application Wizards... 1 Installing and Using the Application Wizards... 2 Table Design... 2 Data Dictionary... 4 Applications... 5 Sage ERP MAS 500 Application Architecture... 5 Customization Project Generation... 7 Dependencies... 9 Wizard Behavior... 10 Step 1 - User Interface... 11 Step 2 - Project Details... 11 Step 3 - Select Columns... 13 Step 4 - Review Choices... 16 Control Types and Data Types... 18 Line Entry Application Wizard... 20 Example Projects... 22 Report Wizard... 25 Starting the Wizard... 25 Building the Project... 30 Error Rigging... 31 Error Rigging User Interface... 32 Visual Basic 6.0 IDE - Conditional Compilation... 33 Ranges... 33 Overview... 34 Local Strings... 36 Overview... 36 Local Messages... 38 Overview... 38 Lookup Definition Maintenance... 41 Overview... 41 Connecting to the Database... 41 Scripting... 42 Lookup Input/Lookup Definition... 43 Select Columns For Display Dialog Box... 45 SQL View Col Mapping Tab... 46 Data Dictionary Lookup Tab... 48 S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE III

Module... 49 Overview... 49 Creating Custom Modules... 50 Step by Step... 50 Assigning Tasks to Custom Modules... 51 Table Population... 52 Data Dictionary... 53 Task Editor... 58 Task Selection... 58 Schema Browser... 61 Standards Checker... 65 Installation/Registration... 65 The Application... 65 Maintain Report Sort Selection Information... 68 Introduction... 68 Using the Utility... 68 S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE IV

Development Utilities This document provides an overview and detailed explanation of different utilities used in the Sage ERP MAS 500 development environment. Every utility has a purpose that supports Sage development strategies. This chapter discusses the following development utilities: Application Wizards Line Entry Application Wizard Report Wizard Error Rigging Ranges Local Strings Local Messages Lookup Definition Module Data Dictionary Task Editor Schema Browser Standards Checker Application Wizards Maintain Report Sort Selection Information Application Wizards are used to create Visual Basic projects that run from the Sage ERP MAS 500 Desktop. Application Wizards build wizard files (files with an AAW extension). These are plain text files containing data collected during each wizard session. The name of the Application Wizard file is the same name that is used to create the VBP file. Both the Application Wizard file and the VBP file are stored in the same location. The Application Wizard file also contains other data, particularly the Data Dictionary information obtained from the system database tables tsmdatadictflat, tsmdatadictcol, tsmdatadicttbl, tsmdatadictrelatn, tsmdatadictviewcol, and tsmdatadictfk. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 1

The Application Wizard collects information used for naming components of the project as well as the sources of data used in the application. The wizard accesses the Data Dictionary to obtain the properties for each column the application binds to so the correct control and configuration are used. When binding to a grid, the Data Dictionary determines cell dimensions and other setup information. The intent is that, following the wizard session, a new application compiles and runs as a Sage ERP MAS 500 task from the Sage ERP MAS 500 Desktop and the coding of the task s business logic can begin immediately. At the end of each wizard session a To Do List displays indicating what additional steps are necessary in order for the new project to run. Some of these items are optional and dependent on the nature of the project being built. Installing and Using the Application Wizards Preparation The Application Wizards make many assumptions about the nature of the applications being built. Success depends on the accuracy and richness of the Data Dictionary information that describes the data. Become familiar with the entire design and build process described in this guide. Development Environment You must first install the source code. After the source code is installed, run the Ranges utility and contact Sage ERP MAS 500 Support to obtain your company code and data ranges for messages and strings. Table Design For more information, see Schema Browser. Primary Key Every table used in Sage ERP MAS 500 must have a Primary key. Surrogate Key A Primary key may or may not be a Surrogate key. Natural Key A Natural key defines uniqueness for each row in a table. Typically, it is a multi-column key that consists of the IDColumn for the table and one or more Foreign keys. In certain cases for performance reasons, the Natural key is defined in a Clustered index. In this case, it is important to ensure that the Uniquekey and OrderBy properties of any Data Manager objects use the Natural key exactly as defined in the clustered index to deliver optimal performance with applications that use grids. If the OrderBy property is not the same as that defined by a Clustered index, SQL Server creates a temporary table for the result set. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 2

IDColumn A table s IDColumn is the only column that is part of the Natural key, but not a Foreign key. This column is generally used as the Lookup control s Bound Column property. In the Sage ERP MAS 500 database there are, however, instances of tables that do not have an IDColumn. In these cases, all of the Natural key columns are Foreign keys and the wizards may have difficulty determining which of the Natural key columns should be used by the Lookup control. For example, the IDColumn for the table tarcustomer is CustID. Example Script The following example script produces two tables that work as the parent and child tables in a Line Entry project. Note that in each case, the Primary key is created as a NONCLUSTERED index. if exists (select name from sysobjects where name = tglalloccjk and type = U ) Drop table tglalloccjk go CREATE TABLE tglalloccjk ( AllocateKey int NOT NULL, AllocID char(10) NOT NULL, AllocMeth smallint NULL DEFAULT 0 CHECK (AllocMeth IN (0, 1, 2, 3, 4, 5, 6)), AllocType smallint NULL DEFAULT 1 CHECK (AllocType IN (1, 2, 3, 4, 5)), CompanyID char(3) NULL, Description varchar(40) NULL DEFAULT, Financial smallint NULL DEFAULT 1 CHECK (Financial IN (1, 0)), LastPostDate datetime NULL, PostCmnt varchar(255) NULL DEFAULT, UpdateCounter int NOT NULL DEFAULT 0 ) go GRANT REFERENCES, SELECT, INSERT, DELETE, UPDATE ON tglalloccjk TO public GO CREATE UNIQUE INDEX XAK1tglAllocCJK ON tglalloccjk ( CompanyID, AllocID ) go ALTER TABLE tglalloccjk ADD PRIMARY KEY NONCLUSTERED (AllocateKey) Go if exists (select name from sysobjects where name = tglallocdetlcjk and type = U ) Drop table tglallocdetlcjk go CREATE TABLE tglallocdetlcjk ( AllocateDetlKey int NOT NULL, AllocAmt decimal(15,3) NULL DEFAULT 0, AllocateKey int NOT NULL, S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 3

Data Dictionary AllocPct decimal(5,2) NULL DEFAULT 0, GLAcctKey int NULL, GLAcctMask varchar(100) NULL, PostCmnt varchar(255) NULL DEFAULT, SeqNo int NOT NULL ) go GRANT REFERENCES, SELECT, INSERT, DELETE, UPDATE ON tglallocdetlcjk TO public GO CREATE INDEX XIE1tglAllocDetlCJK ON tglallocdetlcjk ( AllocateKey, SeqNo ) go ALTER TABLE tglallocdetlcjk ADD PRIMARY KEY NONCLUSTERED (AllocateDetlKey) go When new tables are imported using the Data Dictionary, the Data Dictionary is updated with information that the wizards use to create new tables. The wizards are dependent on this information and typically inform you when essential information is missing; however, the wizards are tolerant, to some extent, of variations to ideal table design and allow the flexibility to normalize the database in a variety of ways. Keys The Data Dictionary defines the Primary key, Surrogate key, Natural key components, and which columns in each table are Foreign keys. The Data Dictionary utility maintains this information and the Application Wizard is dependent on this information. Domains The Data Dictionary utility also allows you to assign DomainIDs to each column. This often determines which controls are used to bind to these columns. Grid Setup Properties When data is presented in a grid, the Data Dictionary defines how each grid column is set up. Column width, caption, and cell type properties are obtained from the Data Dictionary. Report Settings Report projects use Data Dictionary information for the default Sort/Select column usage. Captions and Strings You define Short and Long captions in the Data Dictionary. These are localizable and use tsmlocalstring for their persistence. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 4

Lookup Definitions The Lookup Definition utility is used to create or change Lookup definitions. You use the Data Dictionary utility to assign Lookups to selected columns. Applications Each type of project has its own unique requirements and dependencies. For more information, see Dependencies. Blank Project A Blank project has no data binding specified during the Application Wizard session. Use this project type to build a task that only has the basic Form controls: Toolbar, Status Bar, and references for the commonly used controls and objects including Customizer components. Single Row Maintenance This type of project maintains a single row from a table using the framework s CompanyID value as the key into the table. Typically, Option type application tasks use this methodology. Multi Row Maintenance Multi Row Maintenance tasks use a Lookup to locate a row in a table. The row s data is then populated into the controls on the form for editing. You can add new rows and delete existing rows. Data Sheet Data sheets present data in a grid for editing. You can add new rows or delete existing rows. Line Entry Line Entry tasks maintain the values in a parent/child relationship. The parent table is the header and its values are maintained in bound controls and the child table contains the detail. Child table data is presented in a grid and edited in controls bound to the grid using the LineEntry class. Report The Report Wizard creates standard Sage ERP MAS 500 style report projects. Sage ERP MAS 500 Application Architecture Form Layout Each task, depending on its type, has a standard set of features, and provides the basic means of controlling the form s state, navigation, data validation, and customizing the form during runtime. The form layout consists of the principal UI components and supporting classes that characterizes the look and behavior of Sage ERP MAS 500 applications. Each project type contains both common and unique form layout components. The Application Wizards reproduce these styles before adding any bound controls and other taskspecific UI items. All project styles contain the following components (although their initialization may be different from one style to another): Toolbar - With different options for which buttons are made visible and operable depending on the project type S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 5

Status Bar - The status bar navigation buttons are visible in some project types, but not in others Customizer controls and the Customizer code Validation Manager In addition, and for each project type, you can add the following layouts: Blank Project No other components Single Row Maintenance Tab control to contain bound controls Multi Row Maintenance No other components-all bound controls are placed on the form. Data Sheet Grid, all data is bound to the grid. Line Entry Tab control. Tab 1 contains controls bound to the parent table. Tab 2 contains a grid and the Line Entry frame. Child table data is bound to controls on this tab. Tab 3 is empty and reserved for calculated or derived data. Application Class Module This module is created by the Application Wizard code generator and provides the task s interface to the Framework. The code contained in the class module is always the same except where references are made to names that are specific to the task (for instance, the name of the application s main form module). Application Basic Module This module is created by the Application Wizard code generator and provides the Sub Main(). The code contained in the basic module is always the same except where references are made to names that are specific to the task (for instance, the name of the application s main form module). Common Code Each task, depending on its type, uses many of the Common code modules. The Application Wizard adds these into the project. Data Manager Each bound table requires a Data Manager or Grid Manager. Data Managers deal with the complexity of Control or Grid binding to the database. Data Manager, for most situations, handles the maintenance of data for Insert, Update, and Delete. Business logic requires other techniques, perhaps, for special validations, lookups, and processing. Control Binding Certain controls require special considerations when binding. For example, the Data Manager uses different methods for binding Lookup controls and Drop-Down controls. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 6

Coding Standards Coding standards for programs fall into four major categories: Good Practice - Including a consistent naming convention for controls, variables, and file names Classic Constructs - Techniques developed as reference methods of implementing functionality Design Intent - How controls, common code, and objects are designed to interact with each other Error Handling Adherence to these coding standards and conventions is highly recommended. Customization Project Generation Wizard Sessions During each wizard session, data is collected that is used to build both the user interface and code required to create a Visual Basic project that runs in the Sage ERP MAS 500 environment. The wizards collect information used to name the files that are created and to determine a project directory in which to store them. The kind of project being built determines the information collected and how to build the UI and bind controls to data. Building the UI The following steps are used to create the new task s user interface: Build the form and add form controls appropriate to the type of task (including the grid, if required) Add custom controls (their Left property is set to -10000) Add other bound controls if required Add Customizer components As controls are added to the form, any event handlers along with initialization and termination code they require are added to the form module on the fly. This is also part of the code generation process. For more information, see Code Generation. Controls are added to any of the main elements of a form as prescribed by the project type: To the form To the form s main tab control To the Line Entry frame in a Line Entry project (on Tab 2 of the Line Entry s Main tab) To each of the tabs in a report project There is no dependency in the generated code where these controls must reside and they can be moved as required after project generation is completed. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 7

Code Generation The Application Wizard generates code in three ways: Boilerplate code fragments specific to each project type Boilerplate code with token replacement - The code fragments maintained in the Application Wizard contain tokens that are replaced with data collected from the Application Wizard session. Example: smyname = [*FormName*] Might become: smyname = frmcizng001 The Data Manager binding calls are also made in this way. Generated code - This is typically produced when adding certain types of controls to a form. When adding a Lookup control, for example, the control must be initialized in SetupLookups(), there must be a call to TerminateControls() in PerformCleanShutdown() if one does not already exist, and the control s LostFocus() event must be created. What You See Is Not What You Want When the Sage ERP MAS 500 Software Development Kit (SDK) builds a project, it constructs the user interface and code to make the application run in the Sage ERP MAS 500 environment, and bind to the data. The SDK uses a simple algorithm for placing controls on the form and no attempt is made to layout controls using any aesthetic rules. After coding has started, it is easier to add new controls manually than to regenerate your application and have your modifications overwritten. Sage Controls This section describes how the Application Wizard code generator handles the Sage controls when they are added to a project. Lookup A main Lookup is added to Multi Row Maintenance and Line Entry projects. Both project types initialize the control in the same manner: The LookupID property is set at design time. These are automatically set during project generation. The BoundTable and BoundColumn properties are set at design time. These are automatically set during project generation. This applies only to the Natural key Lookup control, not the Foreign key Lookup control. Code is added to the SetupLookups() procedure to initialize the control. This applies only to the Natural key Lookup control, not the Foreign key Lookup control. A call is added to TerminateControls() in PerformCleanShutdown() if it does not exist. This applies only to the Natural key Lookup control, not the Foreign key Lookup control. Creates the control s BeforeValidate and LookupClick events. Adds the control to the Validation Manager s Keys collection in FormActivate(). S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 8

The control is bound to the modmheader object. Code is added to the HandleBrowseClick procedure to set up the control when the status bar navigation buttons are used. Dropdown The Dropdown control must be initialized with any static list data during task initialization. When a static list is required in the grid of a Line Entry application, specific procedures required to perform the correct display of selected items in the grid and the Line Entry frame. Calendar, Maskededit, Currency, Number These controls are bound to data in BindForm() and/or BindDetail() in the same manner as any non-sage control; there is no special initialization generated by the Application Wizard. Dependencies Project Type Blank Project Single Row Multi Row Data Sheet Line Entry Report Tool Bar Yes Yes Yes Yes Yes Yes Status Bar Yes Yes Yes Yes Yes Yes Validation Manager Data Manager Main Lookup Grid Manager Line Entry Class Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes No No Yes No Yes No No No No No Yes Yes No No No No Yes No Tab Control No Yes No No Yes Yes Bound Controls * No Yes Yes No (just Grid) Yes Yes Customizer Yes Yes Yes Yes Yes Yes *Indicates that columns are bound to controls appropriate to their data type S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 9

Wizard Behavior An Application Wizard has two visual elements: TIP If the wizard warns you that there is insufficient information to build the project you can load this file by selecting Load Project Definition from the menu (the Application Wizard file is already built). Although the project does not build correctly, the wizard generates all of the code and UI that it can with the given information. You can then manually fix the code. The panel on the left, which is used to navigate between wizard steps The panel on the right, which is used to collect information for each wizard step Next Button The Next button is enabled if all of the required information on the current step is valid. If this button is enabled, you can click it to proceed to the next step. Previous Button Move to the previous step by clicking this button. Cancel and Exit Cancel and exit the wizard by clicking this button. Finish Button This button is enabled when the wizard has all of the information required to generate a project (usually on the last step). Step Numbers When a step number is highlighted, it is the current step. You can select a step number to move between steps if the required information is present and valid between the current step and the new step (you can move multiple steps if the intervening steps are valid). When you start a wizard session, you must move sequentially through all of the steps until the last step is reached and the Finish button is enabled. When the last step is reached, you can select any of the previous steps to make changes by selecting a step number. Keyboard Shortcuts When focus is on the left panel s navigation buttons, use the Left and Right cursor keys to move between the Previous, Next, and Finish buttons. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 10

Step 1 - User Interface In the wizard pages that follow, a data sheet application will be built as an example. The specifics relating to each of the project types that can be built with this wizard are also detailed. Step 2 - Project Details First, you need to select the project style to use for the new task. Type the application title, project ID, module ID, form caption, and select the HTML Help check box, if applicable. The HTML Help check box is available only if the ModuleID selected is not a Sage delivered module. For SDK developed modules, you have the option to use WinHelp or HTML Help. Select this check box if the project uses HTML Help. Clear this check box if the project uses WinHelp. It is assumed that you use the Sage ERP MAS 500 naming conventions (for example, ProjectID must always begin with the two letter module abbreviation). S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 11

WARNING Ensure that you create a subdirectory exactly two levels down from Src\App\ so that Visual Basic can find the files in Src\App\Common\. It is highly recommended that you use the default behavior of this feature and the same naming convention and directory tree structure. The files generated from the example shown above are: cizng001.vbp cizng001.frm cizng001.bas cizng001.cls (the Visual Basic name for the class will be clscizng001 ) cizng001.aaw (the Application Wizard data file) All of these files are stored in the following directory: <<Sage MAS 500 SDKSourceRoot>>\Src\App\CI\CIZNG001\ where the directory CI is taken from the first two letters of the ProjectID. These directories are automatically created or you can place the files in a different location; however, it is very important that the relative address to the Common directory is maintained so that the project can correctly reference it. Common files are located in: <<Sage MAS 500 SDKSourceRoot>>\Src\App\Common\ The first two letters of the ProjectID are assumed to be the module identifier as defined in the system table tsmmodule. For more information, see Directory Synchronization below. The Application s ProgID is <<ProjectID>>.<<ClassName>>. The ProgID for the example above is cizng001.clsfobmaint. Directory Synchronization The Application Wizard needs to build projects within a known and controlled environment because each project requires common source files that are referenced in the VBP file using a relative pathname. The Sage ERP MAS 500 development team uses the same project directory structure enforced by the Application Wizard. A Sage ERP MAS 500 Source Root directory exists (for example, F:\Sage MAS 500 SDK\) that can be any directory name off the root of a specific drive. From this directory, the SRC subdirectory contains various types of source code. Application source is located in the SRC subdirectory App, which is where your source files reside. In the App directory, the source is divided into modules, such as GL, AP, and so on. Within each module, additional subdirectories contain the source for each project. The final directory structure should look similar to the following: F:\Sage MAS 500 SDK\Src\App\GL F:\Sage MAS 500 SDK\Src\App\AP The Application Wizard automatically synchronizes the target directory for new projects when you enter the first two letters of the ProjectID. Based on this information, the Application Wizard fills in the Module field and synchronizes the project source directory to the correct module subdirectory. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 12

Step 3 - Select Columns If a new module is created (for example, by entering a ProjectID of QW that does not exist), the Application Wizard prompts you to create the new Module subdirectory. If you made a mistake, click No and start again; otherwise, the new subdirectory is created as a container for the new module s projects. When you enter the complete name of the new task in the ProjectID field and the control loses focus, the Application Wizard prompts you to create the Project directory. If you click Yes, the new directory is created and the complete directory tree for the new project is defined. This is the source code location for all Application Wizard generated Visual Basic files for the project you are creating. If, when prompted to create a new directory, you click No, click the Create Directory button to define your own source code location. This feature adds another sub directory to that shown in the Project Location drive and file list boxes. When this step appears you will notice that some columns are preselected. These are required columns and cannot be removed from the project. These columns are identified by prefixes with the following meanings: *ID* = IDColumn *SK* = Primary key column. This is determined by the Application Wizard and is obtained using the sp_pkeys stored procedure. All tables must have a Primary key defined. *UK* = Both a Foreign key and Natural key column (UK stands for Unique Key because it is returned by the stored procedure spgetuniquekey). These columns must be selected into the project for a data sheet because the Data Manager must be physically bound to all elements of the Natural key. If you do not want to display or edit these values in a data sheet application, hide these columns by setting their ColHidden property to true in the SetupGrid function in the Form Module after the project is generated. Select other columns that are required for the project from the Available Columns list box. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 13

Click the >> button to select all columns, or > to select individual columns. You can also double-click a column to move it the Selected Columns list box. Click the << button to remove all items from the Selected Columns list box or click < to remove individually selected columns. You cannot remove columns prefixed with the asterisk markers. When the selected columns are generated into the project, the binding statements are in the same order as you defined them. Also, controls that are being created use the same order. The Application Wizard provides no way of changing the order after you make your selections; however, where this is important (for example, in a Data Sheet project), you can alter the order in which the data is bound to the grid columns by changing the Bind statements in the BindForm or BindDetail procedures in the generated project s form module. You must also alter the constant definitions for the columns in the Declarations section of the form module. The numbers assigned determine the ordinal position of the columns in the grid. The constants have kcol as the prefix to the table column names, for example, kcolvendid. Natural Key The Natural key is obtained in the following manner: The Application Wizard calls the stored procedure spgetuniquekey. If this returns any columns, they are used as the Natural key. The Application Wizard then queries tsmdatadicttbl for the Natural keys defined for the table. The query that produces the larger number of columns becomes the Natural key. LookupID This is obtained by calling the stored procedure spdddataselect with the table name. If this does not return a LookupID, tsmlookup is queried. If both of these queries fail to find a LookupID, the Application Wizard builds a Simple LookupID using the IDColumn for the name and a suffix to identify the LookupID s owner. To identify the LookupID as belonging to your company or organization, tsmsdkinfo is queried for the value of the CompanyCode column. If tsmsdkinfo does not exist (because the Ranges utility has not been run) _AVT is used as the LookupIDs Company Suffix. The Company Suffix is appended to the column name and the name is truncated if it is too long before adding the suffix. If the name has already been used, numbers are used to make the ID unique, further truncating the name if necessary. You need to alter the Lookup definition using the Lookup Definition utility. A simple LookupID, however, allows the new task to build, run, bind to data, and navigate between rows. Not all project types need a LookupID. The wizards do not create Lookups for Blank Project, Single Row Maintenance, Report, and Data Sheet. If a Lookup is not required, no attempt is made to find or make one. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 14

Order By This is, by default, the same as the Natural key and cannot be changed during the wizard session. If the Natural key has been defined using a Clustered index, the Order By clause must not be changed. Doing so causes SQL Server to create a temporary table, thus limiting performance. Specifics This section details the different requirements of the project types at this step. Blank Project Blank Project tasks have no data binding. This step is not available for this project type. Single Row Maintenance No Lookup control is required for this type of project. The Application Wizard preselects the IDColumn, *ID*. The Application Wizard preselects the Primary key ( *SK* ). Multi Row Maintenance This type of project must have a Lookup. The Application Wizard preselects the IDColumn, *ID*. The Application Wizard preselects the Primary key ( *SK* ). Data Sheet No Lookup control is required for this type of project. The Application Wizard preselects all of the Natural key components (required by the Grid Manager). These contain the markers *ID* and *UK*. The Application Wizard preselects the Primary key ( *SK* ). S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 15

Step 4 - Review Choices The Application Wizard session concludes by presenting the information collected. You can view the information; however, you cannot make any changes. Click Back to return to previous steps to make any changes. To exit the Application Wizard session and build the new project, click Finish. If errors are discovered during the project generation process, they display in a window. These errors fall into three categories: Failure to reference a control or object because it is not correctly registered Failure to locate Common source code because the relative path to..\src\app\common\ cannot be found Other miscellaneous errors that are raised by the Application Wizard or Visual Basic during generation If the problem is a control or object registration problem, you can retry the build process without having to repeat the Application Wizard session. From the Add-Ins menu in Visual Basic, select Sage ERP MAS 500 Repository > Load Project Definition. Browse the choices and select the AAW file. This window defaults to the last Application Wizard file that was generated. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 16

Example of the Print To Do List window After building the project, the ToDo list appears if no errors were detected. Use this information as a guide. Click the Print button to get a permanent record, as this window does not display again. Example of a Data Sheet project The data sheet shown on page 17 was built using the example information processed in the previous pages and demonstrates the following intent and goals: Build a new project without reporting errors during the generation process Compile in Visual Basic without errors Register the project with Sage ERP MAS 500 Launch and run the task (when registered) from the Sage ERP MAS 500 Desktop Save and edit data Insert and delete rows S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 17

There are caveats to this; however, and these relate to the database table(s) to which the task is bound. During the wizard session, you can select as many or as few columns as required. If any columns are not selected into a project, they have required values that are not defaulted and cannot be NULL, and there is no Trigger to obtain the data, then such an application cannot insert rows, and cannot make updates. This may be a valid situation as deriving these values may be part of the application s business logic that the Application Wizard does not have the intelligence to code. Control Types and Data Types The Application Wizard determines what controls are appropriate for each of the selected columns. If the columns are to display in a grid, this becomes the Grid Cell Type defined in the Data Dictionary. If a discrete control is required, as in Multi Row Maintenance, the Application Wizard determines which control is appropriate and defines the control s ProgID for the column. The Application Wizard also provides an appropriate name for the control using a control type prefix (such as, txt, lku, and dat) and the column name from the table. The algorithm for this decision is shown in the following table and involves an analysis of the column s Data Dictionary properties, Data Type, and its DomainID. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 18

Data Dict. Property IsStaticList LookupID <> IsNaturalKey IsForeignKey DomainID Data Type Control SOTADropDown TextLookup TextLookup TextLookup SQL_DATE SOTACalendar MINORENTITYID ACCTSEGVALUE YESNO AMOUNTHC AMOUNTNC AMOUNT TextLookup TextLookup CheckBox SOTACurrency SOTACurrency SOTACurrency SQL_NUMBER SOTANumber WARNING Prior to generating a new project using the procedure described in this section, ensure that any project presently loaded in Visual Basic has been saved or abandoned as required. This procedure forces you to save any currently loaded project prior to generating any new projects. It is safer if you begin with a new project that has not been altered. Default SOTAMaskedEdit The analysis is performed in the same order as the items shown in the table such that a column with DomainID YESNO is hosted in a SOTADropDown if the Data Dictionary property IsStaticList is 1. If no conditions are met the default control is SOTAMaskedEdit. Line Entry projects contain a child table that may have some identical column names to those in the parent table. Child table control names are given the extra prefix: Child, for example, txtchildvendorname. Building the Project This section describes how to build a Sage ERP MAS 500 project using a Project Definition file created by the Report Wizard. Load A Project Definition File Normally, a new project is built immediately after the Application Wizard session finishes. There are times; however, when you may want to repeat the last project build (or any other that has a.aaw file) From the Add-Ins menu in Visual Basic, select Sage ERP MAS 500 Repository > Load Project Definition. Use Windows Explorer to locate the required AAW file. Select the file. During project generation there will be periods of apparent inactivity; at other times, the UI generator and code generator display. The process is complete when the To Do List displays. You can print this list, if required. When you close this window, the project has been built. Follow the instructions in the To Do List to complete the project. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 19

Line Entry Application Wizard This section assumes that you are already familiar with the general concepts of application wizards. The following description details only the specifics of the Line Entry Application Wizard. 1. Enter the project information for the new task. For more information, see Step 2 - Project Details in the Application Wizard section. 2. Select the parent table from the Parent Table Columns combo box. The table is selected and the available columns list box is populated when the combo box loses focus. Select the columns required for the header that will be placed on Tab 1 of the Line Entry Tab control. The wizard creates a Lookup control that is placed on the form (not on the Tab Control) and that is bound to the IDColumn of the parent table. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 20

3. Select the child table and columns from the Child Table Columns combo box. Select the child table to use for the new task. The Child Table drop-down list only lists those tables defined as being children of the selected parent table. Child tables are determined by querying tsmdatadictrelatn. Use the Data Dictionary to set up a parent/child relationship to use in a Line Entry project. Select other child columns that are required to be bound by the detail table Data Manager. You can define the Order By column by selecting it in the Order By drop-down list. The ParentLink defined for the child table is the parent table s Primary key and the corresponding Foreign key in the child table. The table tsmdatadictfk defines the Parent Link columns. 4. Review your choices. Examine the details for the new project and click Back to make changes or click Finish to generate the project. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 21

After the project is successfully created, the ToDo List appears. Example of the Print To Do List window Example Projects Blank Project Example of a Blank project with no additional components S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 22

Single Row Maintenance Example of a Single Row Maintenance project using a tab control to contain bound controls Multiple Row Maintenance Example of a Multiple Row Maintenance project with all controls placed on the form Data Sheet Example of a Data Sheet project with all data bound to the grid S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 23

Line Entry Example showing the controls on the Header tab Example showing the controls on the Detail tab S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 24

Report Wizard The Report Wizard is similar to the Application Wizard. Its purpose is to create an Application Wizard definition file (.AAW) that is used to build a new report project inside Visual Basic's IDE. The wizard collects information about the project, and upon completion, creates the file in the location specified for the project files. Starting the Wizard To start the Report Wizard, open Visual Basic. From the Visual Basic menu, select Add-Ins > Add-In Manager. Select the Sage ERP MAS 500 Repository check box and click OK. Then, select Add-Ins > Sage ERP MAS 500 Repository > Report Application Wizard. Perform the following steps: 1. Enter the project details. Application Title Type the name for the report form. Do not type the frm prefix. This prefix is added by the Report Wizard. The form s name is used elsewhere to create other names in the code that do not require the prefix. Project ID Type the project s name, such as CIZRY001. Module Type the two-letter module abbreviation, such as AP or AR. Form Caption Type the caption that appears on the form. Stored Procedure Type the name of the stored procedure that is used to obtain data for the report. Default Report Type the name of the SAP Crystal Reports.rpt file. The Report Wizard does not create the report file; it only references a report file of that name in the generated code. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 25

HTML Help Select this check box if the project uses HTML Help (available only if the module selected is not a Sage delivered module). For SDK developed modules, you have the option to use WinHelp or HTML Help. Project Location Use the Drive and Directory controls to point at a directory to store the new project. 2. Select the available tables. Select tables from the Available Tables list box and move them to the Selected Tables list box using the > (Add) button. You can also double-click a table to move it to a new location. To remove tables from the Selected Tables list box, select the table(s) and click the < (Remove) button. You can select any table in the Selected Tables list box and move it up or down in the list box by clicking the Up and Down buttons. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 26

3. Sort/select the columns. For each table selected in the previous step, define the Select and Sort columns to use. Sage ERP MAS 500 s Data Dictionary provides the default report columns that are used if no columns are selected. The columns shown in the Sort/Select list boxes are prefixed by *. Tables Select a table from this drop-down list to view the fields it contains. The fields display in the Available Columns list box. Available Columns Select the columns required for the report and use the appropriate > (Add) button to move them to the Sort or Select Column list box. Columns added in this manner have the + prefix denoting that they are not defined as Sort or Select columns in the Data Dictionary. Sort Columns/Select Columns These list boxes display the columns that have been selected for the report. You can arrange the items in either list box by clicking the Up and Down buttons. You can remove columns from a list box by clicking the associated < (Remove) button; however, if a column is defined in the Data Dictionary as being a Sort or Select column, you cannot physically remove them using this window. You can only change the * prefix to -, which is required by the code generator to override the automatic generation of these columns. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 27

4. Select the work tables for the report. Provide the names of the work tables for the report project to use. Type a table name in the Work Table text box and click Add to add it to the list of work tables. To remove a work table, select it in the Work Table list box and click Remove. 5. Select the Key columns. The Code generator needs to know which column in each real table is the Key column. Select each table from the Tables drop-down list and select the Key column in the Available Columns list box. The selected field appears in the Key Column field. Tables This list contains the tables that were selected in step 3. Select a table from this list box in order to identify its Key column. Available Columns This list box displays the column names for the currently selected table. Select the Key column for the table. The column name appears in the Key Column field. To change it, select a different column. Key Column This field displays the currently selected Key column for the currently selected table. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 28

Temp Table This field displays the name of the temporary table that the report project uses. 6. Enter the report options. This step determines the elements that appear on the Options tab of the report form. Format If you select this option, a Format frame is created on the Options tab containing the Summary and Detail check boxes. Message Required If you select this option, a Message frame is created on the Options tab containing five message lines. Include Option Any entries you enter in this option create an Include Options frame on the Options tab. Each item you enter creates a check box inside that frame with the text entered appearing as the check box s caption. Add After typing the caption in the Include Option field, click Add to add the new item to the list. Remove To remove an include option entry, select it and then click Remove. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 29

7. Review your choices. In this step you can review the choices made in the preceding steps and, if necessary, go back to make changes. Tree View The tree view presents the information used to build the project. Click any node to expand the branches to view the data items. You cannot use the tree view to make changes. Finish Click Finish to create the Application Wizard file. The file uses the same name as the project name with an extension of.aaw. This file is stored in the location defined in step 1. To build the project created using this wizard, select Load Project Definition from the menu, browse to the project definition file, and click OK. To load the project into Visual Basic, see Building the Project below. Building the Project This section describes how to build a Sage ERP MAS 500 project using a Project Definition file created by the Application Wizard or the Report Wizard. Loading a Project Definition File To build the project created, from the Visual Basic Add-Ins menu, select Sage ERP MAS 500 Repository > Load Project Definition. Next, browse to the project definition file, and click OK. Use Windows Explorer to locate the required AAW file and select it. You are prompted to confirm that you want the project generation to proceed. If you click Yes, the project is built. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 30

WARNING Before generating a new project, ensure that any project loaded in Visual Basic has been saved or abandoned as required. This procedure will force a save of any currently loaded project before generating a new project. It is safest if users start with a new project that has not been altered in any way. During project generation, you might notice periods of apparent inactivity; at other times you will see the UI generator and code generator working. The process is complete when the To Do List displays. You can print this list, if required. Error Rigging WARNING The Error Rigging engine is supplied on an as is basis and is not yet supported. We welcome and appreciate your comments and feedback on any problems or anomalies found. Example of the Print To Do List window When this window closes, the project is built. Follow the instructions in the To Do List to complete the project. Error Rigging is an automatic process that generates the standard Sage ERP MAS 500 error handler code. Error handler code varies according to the type of module and the type of procedure. Sage ERP MAS 500 Repository provides methods to manage Error Rigging using the following strategies: Rig or unrig an entire module Rig or unrig procedures by type (Sub/Function; Event; Property) Rig or unrig selected procedures (multiselect from a list box) The Error Rigging features apply only to the current module s code window. At this time there is no way to rig an entire project using this tool. The code generated conforms to the standards of the version 4.0 product (then called Acuity) using the VB5.X methodology and is hard-coded in Sage ERP MAS 500 Repository. There are three important considerations when using this tool: Avoid unintended rigging/unrigging Ensure that the main class module for an application is identified to the Rig engine Protect individual procedures from the rig process These consideration are discussed in more detail in the following sections. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 31

Error Rigging User Interface To start Error Rigging from the Add-Ins menu, select Sage ERP MAS 500 Repository > Error Rigging. Example of the Error Rigging Window Rig Style Sage ERP MAS 500 Select the Sage ERP MAS 500 (for ALL Sage ERP MAS 500 Projects) option, which is the default, without exception for any Sage ERP MAS 500 module. Generic For non-sage ERP MAS 500 programs, the Generic style generates a simple error handler that displays a message containing the module name, procedure name, and error description. This style may not be used for Sage ERP MAS 500 modules. Rig Targets All Rigging or unrigging is applied to all procedures, properties, and events in the current module. The Error Rigging process does not affect any procedures that have Custom Error Handlers, or that contain the following line of code: +++ VB/Rig Skip +++ Selected Types Rigging or unrigging is applied to the selected types: Subs and Functions Events Properties Selected Procedures This selection displays a list box containing all of the riggable procedures in the current module. Select one or more procedures to rig or unrig. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 32

Prompt before Rigging/Unrigging If you select this option, you are prompted for permission to process each procedure selected during the Rigging or Unrigging process. If you clear this option, all selected procedures are processed. Be aware that there is no way to cancel the process after it is started. Apply Click Apply to begin the rigging process. Rigging is only applied to selected procedures that have no Error Handler code. Any procedure that has an error handler is skipped. You can place the following line inside any procedure that you never want to be rigged: +++ VB/Rig Skip +++ If you want standard error handling, do not modify any of the code that is generated by the Error Rigging process as it may cause the code to be unriggable. If you need to change error handling code, create a custom handler and remove all of the generated comments. Ensure that error handler labels are different than those generated by the rigging process. Remove the following comment lines: +++VB/Rig Begin Push +++ and +++ VB/Rig End +++ Remove Click Remove to begin the unrigging process. Unrigging is not performed on procedures that contain custom Error Handlers. Unrigging is only performed on procedures that have been previously rigged using the Sage ERP MAS 500 SDK. During the unrigging process, the following line of code is added to the Declarations section if the application s Main Class Module is detected: Private Const kbclassismainclass = True This is required so that special rigging code can be applied to the public methods of the module that are used by the Sage ERP MAS 500 Desktop. If this line of code is missing from your application s Main Class Module, it needs to be added before the Rigging process is applied. Exit Click Exit to close the Error Rigging window. Visual Basic 6.0 IDE - Conditional Compilation The Visual Basic 6.0 IDE presents the following problem: When code is excluded because of Conditional Compilation settings, this code is not visible to the Error Rigging engine. To error rig these procedures, you must ensure that they are included by appropriate Conditional Compilation settings. Always verify that you have exposed all of the procedures subject to Conditional Compilation. Ranges The Ranges utility is used to reserve unique ranges for system data you add. If you are creating an add-on package, this utility helps to prevent conflicts with data that is being installed from other add-on packages. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 33

You can find the utility by selecting the Start menu, and then selecting Programs > Sage Software > Sage ERP MAS 500 SDK > Data Range Maintenance. Overview Several tables in Sage ERP MAS 500 store system information that can be used for customization. These tables are: Strings Lookups Messages Modules Tasks Menus Dictionary information Each module that Sage produces has reserved certain ranges of key values in the tables listed above. All add-on packages should also reserve a set of ranges for the above information in order to prevent conflicts with future Sage ERP MAS 500 data and other third-party packages. The Ranges utility has been modified to allow a new range for module numbers: 1,000 32,767. The Ranges utility is used to enter the ranges you reserve. All of the Application Framework utilities use the entered ranges to restrict entry. To reserve your ranges, contact Sage ERP MAS 500 Support. Who Should Use It Anyone creating an add-on package or any company that is developing multiple Sage ERP MAS 500 Customization projects on different databases should use the Ranges utility to avoid conflicts. How It Works The Ranges utility creates a table called tsmsdkinfo to store the ranges. Sage ERP MAS 500 uses the default ranges, which do not conflict with Sage ERP MAS 500 ranges but could conflict with add-on packages if you do not reserve specific ranges. All of the Application Framework utilities restrict input to the ranges defined in tsmsdkinfo. Ranges Input The following section explains the input fields on the Ranges form. Example of the Assign Data Ranges window S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 34

NOTE All existing users need to add 1,000,000,000 to the Task Sequence # From and Task Sequence To values assigned to them and also enter these numbers into the Assign Data Ranges dialog box at the Task IDs From and Task IDs To fields. Company Code The Company Code field is a universally unique identifier for your company. It is used to uniquely identify any system data with character keys. The standard code contains all character-based keys that end with an underscore followed by your company identifier. For example, if company ABC adds a Lookup to the system that would list shipments, it would be called SOSHIP_ABC. Modules From/To These fields define the range of module numbers you are allowed to enter into Sage ERP MAS 500. Tasks IDs From/To These fields define the range of task IDs you are allowed to enter into Sage ERP MAS 500. Strings From/To These fields define the range of string numbers you are allowed to enter into Sage ERP MAS 500. Messages From/To These fields define the range of message numbers you are allowed to enter into Sage ERP MAS 500. Transaction Types From/To These fields define the range of transaction type numbers you are allowed to enter into Sage ERP MAS 500. Entity Types From/To These fields define the range of entity type numbers you are allowed to enter into Sage ERP MAS 500. Data Alerts From/To These fields define the range of base data alert numbers you are allowed to enter into Sage ERP MAS 500. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 35

Local Strings The Local Strings utility helps you maintain simple text strings for multilingual purposes. Overview WARNING You cannot use this utility to maintain strings in other languages. TIP The Local String utility file is saved in a special format. A string is text that displays on Sage ERP MAS 500 forms and reports. Strings can be in English, French, or Spanish. You find all text strings in the tsmstring and tsmlocalstring tables in the Sage ERP MAS 500 system database. Every task that displays a string can call a function that retrieves it. The utility is located in the \Utilities folder under your SDK installation folder. The first time that you use the utility you need to: 1. Register the task in Sage ERP MAS 500 by using the Task Editor. The Object Prog ID of the utility is Strings.clsTaskClass. Name it Strings Maintenance. 2. Add the task to the Sage ERP MAS 500 Desktop. For more information, refer to your Getting Started guide. 3. Use System Manager s Maintain Security Groups utility to set up permissions for the utility. Who Should Use It Sage recommends that you save your text strings in an external table, although doing so requires more time than specifying it in code. Choosing not to use the utility does not compromise the application s functionality, but the utility can be useful when upgrading to a different language. How It Works The Local String utility divides all of the available text strings in Sage ERP MAS 500 into modules. A number and a constant identify each string. Each module has a range of numbers that it uses (for example, Accounts Receivable ranges from 150000 to 159999). Each module maintains its own strings separately from the other modules. This utility allows you to browse the list, add, delete, and edit your strings; however, you cannot delete and add strings that belong to Sage ERP MAS 500 modules. You can add strings to your own modules, which reduces the chance that your data will collide with other add-on modules. For more information about adding a module, see Module. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 36

Local Strings Input The following section describes the Local Strings utility. Example of the Maintain Strings window Number This field indicates the unique number that identifies the string. When adding a new string, the string number defaults to the next highest unused number within the module range. Constant This field represents the constant name that is used during Visual Basic development to identify the localized string. When generating a string.bas file for your localized strings, the following line of code will be generated: Public Const <CONSTANT> = <NUMBER> Local String This field represents the localized text string. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 37

Local Messages The Local Messages utility helps you maintain messages that Sage ERP MAS 500 uses. This utility is primarily used for multilingual purposes and for controlling the messages that appear without recompiling the task. The Sage ERP MAS 500 message boxes use these messages to take advantage of a message s properties. Overview WARNING You cannot use this utility to maintain strings in other languages. TIP The Local String utility file is saved in a special format. Sage maintains messages in an external source for multilingual and control purposes. Messages are considered to be text that displays in a Sage-specific message box. You can display a message in English, French, or Spanish. Specifying the language ID displays all messages using Sage s message box in that language. Every message has properties such as button types, message icon, and a default button. You can find all messages in the tsmmessage and tsmlocalmessage tables in the Sage ERP MAS 500 database. Every task that displays a message box can call the message box and specify the message number and language ID. The utility is located in the \Utilities folder under your SDK installation folder. The first time that you use the utility you need to: 1. Register the task by using the Task Editor. The Object Prog ID of the utility is Messages.clsTaskClass. Name it Messages Maintenance. 2. Add the task to the Desktop. For more information, refer to your Getting Started guide. 3. Use System Manager s Maintain Security Groups utility to set up permissions for the utility. Who Should Use It Sage recommends that you save your messages in an external table, although doing so requires more time than specifying messages in code. Choosing not to use the utility does not compromise the application s functionality, but the utility can be useful when displaying consistent messages and when expanding to a different language. How It Works The Local Messages utility divides all of the available messages in Sage ERP MAS 500 into modules. A number and a constant identify each message. Each module has a range of numbers that it uses (for example, Accounts Receivable ranges from 150000 to 159999). Each module maintains its own messages separately from the other modules. This utility allows you to browse the list, add, delete, and edit your messages. You can add strings to your own modules, which minimizes the chances that your data will collide with other add-on messages. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 38

Local Message Input The following section is a description of the Local Messages utility. Example of the Maintain Messages window Example of editing a message properties using Localize Messages Message No This number identifies the message. Help Context No The Help ID is used by the display message Help. Message Icon This selection identifies the message icon that appears on the message box. Message Text This text indicates the actual message that displays to the user. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 39

Comment This information indicates a comment that explains the message and where it is used. Editing the message box buttons using Localize Messages Buttons Select the button type that represents the message to display. Cancel Select the button that is activated when the user presses ESC. Default Select the button that receives the focus when the message dialog box appears. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 40

Lookup Definition Maintenance Use Lookup Definition Maintenance to create new and update existing lookup definitions. Overview The Lookup definition is used by the Lookup control to provide information on what data to retrieve and how to display it. The most important information that the definition provides is the following: The command name (Table or View) from which the records are retrieved The columns to display The columns to return back to the application The Lookup ID uniquely identifies the Lookup definition and is used by the application to assign to a Lookup control. The task that activates the control is responsible for informing it of the Lookup ID. To properly display the column information, any new table used by a Lookup definition or in a SQL view of a Lookup definition should have its metadata in the Data Dictionary. Use the Data Dictionary utility to import any new table into the Data Dictionary. If this is not done, the Lookup control will still work, but usability and cosmetic features may be diminished. For any Lookup definition using a new SQL view, the SQL view should be registered in the Data Dictionary. You can do this from the SQL View Column Mapping tab in the Lookup Definition Maintenance utility. The Lookup Definition Maintenance utility is located in the \Utilities directory under your Sage ERP MAS 500 Customization installation directory. The first time you use this utility, you need to add a shortcut task on the Sage ERP MAS 500 Desktop. For more information, refer to your Getting Started guide. Connecting to the Database In the Lookup Definition Maintenance window, select the Connect menu to invoke the Database Connection dialog box to connect to the application database. Example of the Database Connection dialog box S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 41

Scripting Script can be generated for all updates applied to the database that occur in this maintenance form. Generate Script In addition to maintaining the Lookup Definition in the database, you can also generate script to be applied to other databases. Select the Generate Script check box to record your Lookup Maintenance script. Script Toolbar Button After the script is generated, this toolbar button becomes enabled to signify that the script has been generated. To view the script, click the Script button. The Lookup View Maintenance Script dialog box appears. Example of the Lookup View Maintenance Script window The following is a list of things you can do with the script: Save the script to a file. Click the Save button. The Save As dialog box appears in which you can enter a file name. Prepare an Outlook e-mail message containing the script. Click the Email button. A message dialog box appears prompting you to enter an e-mail address. Click OK. The Outlook message appears. The message is not sent - you must click Send in Outlook to send the message. This feature is available only if Outlook is on your system. Copy the script to the Windows Clipboard. With the text selected, press CTRL+C to copy the script to the Clipboard. Clear the script. Click the Clear button to clear the script. A message dialog box appears prompting you to verify this action. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 42

Lookup Input/Lookup Definition The following section details the input fields on the Lookup Definition Maintenance window. The Save and Delete buttons apply only for entries described in this section. Example of the Lookup Definition Maintenance window Lookup ID To create a new Lookup ID, click the Add button. Type the name of the new Lookup ID and press the TAB key. After saving a new Lookup definition, the Lookup ID is added to the list of existing entries and the form goes into edit mode. Click the Cancel button to clear the form. To maintain an existing Lookup ID, select the Lookup ID from the Lookup ID drop-down list. You can start typing in the drop-down box to help in your search; you will need to press the DOWN ARROW key to make the selection appear as the first item below the control in the list. At this point, your form will not be in Edit mode. Module Select a module name from the drop-down list to attach the Lookup definition. This is for information purposes, but is also required in order for a new Lookup definition to be saved. Command Type The command type can either be a SQL view or a table. Name Based on the command type, this is the name of the view or table that becomes the data used by the Lookup definition. You can either type the command name or press the ellipses button to display a modal dialog box, which displays all the tables or views in the application database. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 43

LookupView ID Lookup View ID is the name that identifies the initial view for this Lookup. The default is Standard. You can enter up to 30 characters. The LookupView ID field differs from the Lookup ID field in that there may be many differently named admin and user-customizable views created for one Lookup definition. Immediate Results This check box determines whether or not to display the results of the Lookup Definition query when the Lookup Form message dialog box appears. The default setting is selected to indicate results immediately. This option can be overridden by the administrator from the Maintain Lookup Views task. Restrict to Display Columns This check box determines whether or not to restrict customization to the set of columns set up initially for display. The default setting for the check box is cleared to indicate the feature is unrestricted. This option can be overridden by the administrator from the Maintain Lookup Views task. Display Columns To specify the display columns, click the ellipses button to display the Select Columns For Display dialog box from which to choose the set and the order of the display columns. The set of display columns may be mutually exclusive from the set of return columns. Do not include System columns (columns having IsInternal=1 or IsSurrogateKey=1 in the Data Dictionary) because the columns will be hidden. Return Columns To specify the return columns, click the ellipses button to display the Select Columns For Display dialog box from which to choose the set and the order of the return columns. The set of return columns may be mutually exclusive from the set of display columns. Quick Filter Column Name Select the column name to use initially as the "quick filter" column. The list of quick filter column names is determined by the set of column names shown in Display Columns having string data types. The string data type requirement is needed because the only quick filter operator allowed from this maintenance form is Begins With. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 44

Select Columns For Display Dialog Box The Select Columns For Display dialog box is used for maintaining both the display columns and the return columns. Example of the Selected Columns For Display dialog box Available Command Columns This list box contains the entire set of column names from the command name minus any columns already selected. Display Columns This list box contains the chosen set of columns. Move > Adds a column to the end of the Display Columns list box. Select a column name in the Available Command Columns list box and click Move >. < Move Removes a column from the Display Columns list box. Select the column name that you do not want and click < Move. Up Reorders a column up a level in the Display Columns list box. Select the column and click Up. Down. Reorders a column down a level in the Display Columns list box. Select the column and click Down. Clear Removes all columns from the Display Columns list box. Cancel Cancels any changes and returns to the maintenance form. Done Accepts changes and returns to the maintenance form with the new values. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 45

SQL View Col Mapping Tab The SQL View Column Mapping tab provides a maintenance utility of its own related only to the SQL view command used by the Lookup definition. This tab becomes visible and enabled when a valid SQL view command name has been entered or displayed. This tab becomes useful if you have designed a new SQL view or modified an existing SQL view that is used by a Lookup definition. For the Lookup Control to make use of Data Dictionary information, the SQL View columns must be mapped to their underlying tables and columns. This information is stored in the tsmdatadictviewcol table. View Script The Create View script is displayed but cannot be maintained here. Use SQL Enterprise or another view creation tool to properly maintain SQL views. SQL View DataDict Column Mapping grid The SQL View DataDict Column Mapping grid displays all the mapping data for the SQL view. SQLViewColName - The name of the column in the SQL view. TableName - The name of the underlying table. ColumnName - The name of the underlying column. SQLViewColName - The column caption to use instead of what is in the Data Dictionary. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 46

Get SQL View Column Mapping from Create View Script Click the Get SQL View Column Mapping from Create View Script button to determine the SQLView column mappings. This does not write to the database, but updates the SQL View DataDict Column Mapping grid, where you are allowed to view and maintain the data. The column mapping is performed by executing the SELECT statement of the SQL view and using ADO field properties to get the BASETABLENAME and BASECOLUMNNAME. This process works as long as the data is not manipulated with a COALESCE or CONVERT function, for example. If a SQL view is comprised of a UNION or other SQL views, the BASETABLENAME and BASECOLUMNNAME may not exist in the ADO Field Properties. In cases like this, you may need to maintain your own mapping rows for these columns. An additional feature of this column mapping button is its ability to create new SQL view column captions if there is a discrepancy between SQLViewColName and the underlying ColumnName. The assumption is that the column must have been aliased and therefore the base column's caption is not descriptive enough. The new CommonDLL DDCommon contains an algorithm to create the new caption. It splits up the SQLViewColName value by proper casing. For each proper cased word (most likely abbreviated word), it gets the unabbreviated word and joins them all together putting a space between each word to create the new caption. Example: RcvgWhse becomes Receiving Warehouse Save DataDict SQLView Column Mapping Click the Save DataDict SQLView Column Mapping button, to save the mapping. This writes all the rows from the SQLView DataDict column mapping grid to the tsmdatadictviewcol table for the SQL Command. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 47

Data Dictionary Lookup Tab The Data Dictionary Lookup Tab contains data from execution of the spddgetlookups stored procedure, which is the same stored procedure used by the Lookup control to get Data Dictionary information regarding the Lookup Definition columns. The data in this grid is for information purposes only. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 48

Module Overview The Module utility is used to add custom modules to Sage ERP MAS 500. If you have not contacted Sage ERP MAS 500 Support to obtain Third Party Add-on Ranges, you need to do so before using this utility in order to set up your new module. When creating a new application, you should use this utility. The module number must fall within the range defined in the Ranges. After a module is added, it shows up in the Task Editor, Local Strings, and Local Messages utilities, where you can add your data to the new module. The utility is located in the \Utilities folder under your Sage ERP MAS 500 Customization installation folder. The first time that you use the utility you need to: 1. Register the task by using the Task Editor. The Object Prog ID of the utility is Module.clsModule. Name it Module Maintenance. 2. Add the task to the Sage ERP MAS 500 Desktop. For more information, refer to your Getting Started guide. 3. Use Maintain Security Groups in System Manager to set up permissions for the utility. Who Should Use It Anyone who creates an add-on to Sage ERP MAS 500 or an in-house application should use the Module utility. Module Input The following section details the input fields on the Maintain Modules window. Example of the Maintain Modules window Module ID The Module ID field is the two-character abbreviation for the module. Module Number The Module Number field is the Surrogate key for the module. Module Name The Module Name is the descriptive name of the module. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 49

Creating Custom Modules You can add a custom module to contain your own applications. The process includes obtaining data ranges from Sage ERP MAS 500 Support, identifying and registering the module, and adding your custom tasks. You then customize the Sage ERP MAS 500 Desktop to add the new tasks to a new or existing Desktop page or menu. Before You Begin Before creating your module, build the different tasks and tables required by the module. Use the Application Wizards in Visual Basic to build your applications. Step by Step NOTE Data ranges are only assigned to individuals who have completed Sage ERP MAS 500 SDK training. Entering Data Ranges E-mail Sage ERP MAS 500 Support at MAS500Support@sage.com and request your data ranges. If you have completed Sage ERP MAS 500 SDK training, they will assign data ranges for module, task sequence number, strings, and messages. Module numbers identify modules internally. The tsmtask table has two columns: TaskTypeID and ModuleNo. The TaskID column no longer contains the module number and the task type, which previously only allowed for 127 modules. The module number and task type are no longer extracted from the task ID. Instead, this information is retrieved from the tsktask table, allowing for more flexibility. The first seventy-five module numbers are reserved for Sage. String and message identifiers are for local strings and messages; values can be set from 1,000,400 to 2,147,483,647. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 50

Assigned Ranges 1. Contact Sage ERP MAS 500 Customer Support and obtain your assigned ranges. 2. Run the Data Range Maintenance application from the Sage ERP MAS 500 SDK program group. For more information, see Ranges. 3. Change the default data ranges to the assigned data ranges. Defining the Module After your data ranges are assigned, run Module Maintenance to define the module. Enter a two-letter code to identify the module, a module number from within your assigned module number range, and a module name. TIP If more than one company will use the module, activate the module for each company. Activating the Module After the module is defined, activate it for each company using Maintain Companies. Select a company and click Activate Modules. The Activate Modules message dialog box appears. Modules that are not licensed cannot be activated. Contact Sage ERP MAS 500 Support to arrange licensing for your module. Assigning Tasks to Custom Modules NOTE If Task Editor does not appear on your Tools menu, right-click the System Manager page and select Properties > Customize to add your tasks to the Desktop. After a module is activated, associate tasks with the module. Select Task Editor from the System Manager Tools menu. The Task List window displays. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 51

Click Add New Task to access the Task Editor window. Enter task information to associate with a module, a launch type, a task type, and all other task information. For more information about the controls on this interface, refer to your Sage ERP MAS 500 SDK Programming Components guide. The system stored procedure, spgetnexttextid is used to return the next task ID. This stored procedure also uses the data found in the tsmsdkinfo table to provide additional criteria when returning the next task ID. Each task must have assigned security permission. When a new task is entered, a Default Permission control appears on the dialog box below the Description control for assigning such security. The control only appears for unassigned tasks. Select the task s default permission from the list. As your tasks become associated with your module, they are added to the list of tasks. Customizing the Sage ERP MAS 500 Desktop Your module is now complete and ready to add to the Sage ERP MAS 500 Desktop. For more information, refer to your Getting Started guide. Table Population The following tables are used or affected by module creation. tsmcompanymodule Contains which modules are registered with which companies. tsmmodule Stores the module number, installation date, and version number. The installation date and version number are used for registration and licensing. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 52

Data Dictionary tsmmoduledef Associates the module number with a two-letter module identifier. tsmmodulesetup Provides the task ID that activates the module, as well as sequence number if more than one task is required. tsmmodulestrdef Contains the unabbreviated name for each supported module. tsmseed Tells cizaa001.exe what tables to seed with data from other tables during module activation. tsmsdkinfo Dictates the legal values for certain system-wide values. The values limit the range in which you are able to create and edit tasks, strings, messages, and modules. This utility gives you the ability to view and modify the Sage ERP MAS 500 Data Dictionary information. It is also used to import new tables into the Data Dictionary and to alter Data Dictionary information about existing tables. The Data Dictionary is also known as Data Customization. The Data Dictionary provides supplemental information about database objects. This information is helpful in customizing Lookups, reports, and forms. For example, the Data Dictionary stores the default caption for a particular table and column, which displays as the grid column header for any Lookup that includes the table and column. This caption is also used in reports as a default caption and is used in forms. Other Data Dictionary information includes: Default column widths Default number of decimal places for a number Default value The utility is located in the \Utilities folder under your Sage ERP MAS 500 SDK installation folder. The first time that you use the utility you need to: 1. Register the task by using the Task Editor. The Object Prog ID of the utility is DataCust.clsDataCust. Name it Data Dictionary Maintenance. 2. Add the task to the Sage ERP MAS 500 Desktop. See the Getting Started guide for instructions. 3. Use Maintain Security Groups in System Manager to set up permissions for the utility. Most table columns in Sage ERP MAS 500 are assigned to a domain. A domain defines certain characteristics about a column. For example, one domain is called Amount. All columns in this domain have two decimal places by default. You can also assign specific characteristics to a column. These characteristics have precedence over domain information. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 53

Domain Input The following explanations detail the input fields on the Domain Attributes form. Example of the Domains tab in the Data Customization window Default Value This field defines a default value on forms for any control bound to this column. Usage Not implemented. Supervisor Usage Not implemented. Grid Column Width This field indicates the default grid width of a grid column. This information is useful in particular for description fields, because they may be very large in the table, but you may only want to show a small size column in the Lookup. Caption This field identifies the default caption for the domain. This caption appears in the Lookup column header, in reports where the column is used, and on form captions when the Data Dictionary is implemented in forms. Short Caption This field is similar to the caption field, except that it is used when space is limited on a form, report, or Lookup. Lookup ID This ID is used in the selection grid in reports. If set, a Lookup control appears next to selection fields during data entry. Any values assigned into the Data Dictionary in the table/column view override the domain values. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 54

Adding a Domain To add a new domain, from the File menu, select Create New Domain ID. The Add Domain dialog box appears: 1. Enter the name of your domain and click OK. The new domain becomes part of the domain list. 2. Select the new domain from the list and enter the attributes according to the Domain Input. Table/Column Input The following explanations detail the input fields on the Column Attributes form. See the previous view for all fields except Report Sort and Report Selection. Example of the Table/Column View tab in the Data Customization window Report Sort Select this check box to display this column on report form sort grids. Report Selection Select this check box to display this column on report form selection grids. Static List Select this check box to make this column appear as a drop-down list with multiple values. If selected, the column is in the StaticList domain. Nullable Select this check box to indicate that this column is Nullable (defined in SQL Server). Primary Key When selected, this check box indicates that the column is the Primary key. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 55

Surrogate Key When selected, this check box indicates that the column is a Surrogate key. Natural Key When selected, this check box indicates that the column is part of the Natural key. Foreign Key Select this check box if the selected column is a Foreign key from another table. You must do this for each column of the Natural key that is a Foreign key for the wizards to function properly. Importing Table Information from SQL Server You can import table information from SQL Server to the Data Dictionary. From the File menu, select Import Table. The Table Import Process creates new entries in tsmdatadictflat, tsmdatadictcol, and tsmdatadicttbl. The import process automatically determines which column is the Primary key and sets this value in the Data Dictionary. It also attempts to determine the Natural key by checking for a Clustered Index. If no Clustered Index exists, you must manually enter the Natural key. If the table s Primary key is a Surrogate key, this must be defined during the Import process. Importing a New Table Select the table to import from the Table To Import combo box. This contains a list of all of the tables in the database including those that have already been imported. When a table is selected you are notified whether the table exists in the Data Dictionary. If it does, and you want to re-import this table, you must delete the table information from the database before re-trying this operation. You do not need to do this each time you alter a table definition because some attributes can be edited; however, if you have added or removed columns you must delete the table and import it again. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 56

If the Natural key cannot be automatically determined (the Natural key text box is empty), enter the columns that make up the Natural key separated by commas. Enter the columns in the same order as they are defined in your Natural key index. If the table has a Surrogate key, select it in the Surrogate Key drop-down list. Click the Import button to initiate the process. Altering Table Key Information Whenever you select a table in the Table/Column tree view, the table attributes display. Using this view, you can change the Surrogate Key column, the Natural Key columns, or you can add child table relationships to the selected table. When a table is selected, the Data Dictionary utility checks the synchronization of the Natural key, Primary key, and Surrogate key defined in tsmdatadicttbl and the values maintained in tsmdatadictcol and tsmdatadictflat. If they are not synchronized, the Synchronize Keys button is enabled. In this case, check the values that display in this view to determine that they are correct and then click the Synchronize Keys button. If the values are incorrect, make the necessary changes and then click the Synchronize Keys button. Note that you cannot change the Primary key column because the SQL Server determines this. If, however, the Primary key that is defined in the Data Dictionary is wrong, it is automatically corrected. Any changes that you make in this view are saved when you move to any other tree value or view. Adding Child Tables To define a child table to the currently selected table (the parent), click the Add Child Table button. To define a parent/child relationship, you need to know the column in the child table that is the Foreign key from the parent and the Update/Insert/Delete rules to apply to the parent and child. This feature maintains information in tsmdatadictfk and tsmdatadictrelatn. 1. Select a table from the Child Table drop-down list. 2. Select a column from the Related Column drop-down list. 3. Set the Restrict to CompanyID checkbox as required. 4. For each table and for Insert, Update, and Delete set the rules to apply to the relationship. 5. Click the Add/Update Child Table button to commit the values. 6. Manually create the triggers to support these rules. To Remove a Child Table 1. Select a child table from the Existing Child Tables list box. 2. Click the Remove button. To Alter Child Table Attributes 1. Select a child table from the Existing Child Tables list box. 2. Make changes to the child table attributes or rules. 3. Click the Add/Update Child Table button. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 57

Task Editor TIP All tasks can be invoked from the Desktop, or from a call to the Framework s LoadSOTAObject method. Task Selection The Task Editor utility registers and manages the task definitions for objects that can be run within the Sage ERP MAS 500 Desktop. The Task Editor displays when you add a new task to the task list or edit the properties of an existing task. Use the Task Editor to specify how the task invokes, which object is instantiated when calling the task, and which module it belongs to. The first time that you use the utility, you must use Maintain Security Groups in System Manager to set up permissions for the utility. Selecting a task from the Task List allows you to remove an existing task or add a new task. The registered tasks display in the Task List window. Example of the Task List table from the Task Manager utility Controls The Task List window displays basic information for each task functioning as an Automation server. The task must be selected before it can be removed or have specific properties edited. New tasks can be registered using this utility. After registering, you can add a task as an item to a module tool button menu. Task List Tasks are listed by their corresponding Task ID. The list is sorted numerically. Double-clicking the entry in the Module column displays a window from which you can edit the task definition. Close Click Close to close the application. Add New Task Click Add New Task to display a window for editing a new task definition. The window is identical to the window that is used for editing existing tasks. Remove Task Click Remove Task to delete the selected tasks. A confirmation dialog box displays before proceeding with the remove operation. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 58

Task Editor Input The following section details the controls on the Task Editor window. Example of the Task Editor window Launch Type This field specifies the task type. Available choices are: Standard,.NET Standard, and Security. Security and.net Standard are two task types that were added to tsmtasktypedef and tsmtasktypestrdef. The.NET Standard task is a.net application for the Business Insights Analyzer, which is launched by the Desktop. The Security task is a type of task for granting task security permission only. Currently, there are two security tasks in Sage ERP MAS 500: Form Customizer and Desktop Customizer. Users with permission to these tasks are able to use either Form Customizer or Desktop Customizer. Module This field specifies the module that the task belongs to. Modules are important for organizational purposes and for security reasons. If a task is part of the Accounts Receivable module, and Accounts Receivable is not registered for the current company, the task is not available on the menu. SQL View If the Launch Type is.net Standard, the user creating/modifying the task must select a valid SQL view from this drop-down list. SQL views are pre-configured views of specific data within the application database. Advanced users can also create SQL views; this requires advanced knowledge of SQL and the Sage ERP MAS 500 schema. System Task Select this check box to indicate a system task. All system tasks are available to all modules regardless of security permissions. Task Type Select the type of operation that the task is performing. The available type could be maintenance, drill around, listing, activity, posting, and so on. These categories are currently used for organizational purposes and are disregarded by Sage ERP MAS 500. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 59

Task ID The system stored procedure, spgetnexttextid is used to return the next task ID. This stored procedure also uses the data found in the tsmsdkinfo table to provide additional criteria when returning the next task ID. The new range for this field is 1,000,000,000 2,147,483,647. Ranges are assigned by Sage ERP MAS 500 Support. For more information, see Ranges. Constant Enter a constant that identifies the task. Use the variable name standards for constants format: k<moduleid><task name> (no spaces or illegal characters for constants are allowed). Name Enter a descriptive name that explains the task function. This name is used to identify the task. Create the name using the following format: <module id> <descriptive name>. Description Enter a detailed task explanation. Default Permission The default permission is the security permission assigned the task when it is first created. The permissions available are: Display Only, Excluded, Normal, and Supervisory. Object ProgID Click this button to select the class that is instantiated by the Object Manager. The class must support the object interface that you define in the next field. Create Only One Copy of the Object Select this check box to restrict the object to one instantiation. Future calls for the task use the original object because a new one cannot be created. Typically you do not use this option. Integer Parameter Set up this value for the framework object lrunflags property. String Parameter Set up this value for the framework object bstruseroptions value. Web Enabled Select this check box to indicate that the task can be invoked from the Web, such as a Web report. Client Enabled Select this check box to indicate that the task is a Sage ERP MAS 500 client task. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 60

Schema Browser Task Flags The following are options that control the behavior of the task. Manual Load UI - If you select this option, the Object Manager does not load the object. You need to call the LoadUI method of the object. Manual Display UI - If you select this option, the Object Manager/ Framework does not show the UI. You need to call the ShowUI method of the object. Self Shutdown - Use this object if you do not want the Object Manager to shut down the object under any circumstances. The object is responsible for shutting itself down. Run Standalone - Use this option to launch the task only if you do not want the task to be considered a child task of the calling object. The Object Manager does not shut down this task if the calling object terminates. Always Visible - The Object Manager does not hide the form under any circumstances. Don t Allow Run-time Override of Flags - Select this option so that the calling task cannot override the flags that are set for the task. A hypertext browser is included in the Sage ERP MAS 500 SDK, which allows you to view the Sage ERP MAS 500 database schema without opening a Sage ERP MAS 500 database. The utility allows you to browse through the relationships between tables, view indexes, foreign keys, and retrieve explanations on the different columns. You can launch the utility by selecting Programs > Sage Software > Sage ERP MAS 500 SDK > SchemaBrowser from your Start menu. The utility is easy to use and consists of six major windows: Module menu Module window Diagram window Table window Relationships window Keys window S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 61

Module Menu Example of the Module Menu window Module Window Example of the Module window S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 62

Diagram Window Example of the Diagram window Table Window Example of the Table window S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 63

Relationships Window Example of the Relationships window Keys Window Example of the Keys window S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 64

Standards Checker The Standards Checker is a Visual Basic add-in that automates the checking of defined standards. This add-in does not perform a complete check of the standards because some standards cannot be determined by scanning source code (for example, All display-only description fields should be Label controls ). Installation/Registration To install/register the add-in, run Regsvr32 on the AddinStdsChecker.dll. This registration process will make this add-in available from the VB Add-in Manager. The previous version of this utility (SOTAUTIL.EXE) was based on Visual Basic version 5.0 Add-In Model, which utilized the VBAddin.ini file. The next time Visual Basic is started, access the Add-Ins menu and select Add-In Manager... There should be an entry for Standards Checker. Select this option to add the Standards Checker Add-In to the Visual Basic IDE. The Application The Standards Checker runs inside a dockable tool window. If this window is closed, it can be redisplayed by selecting the Standards Checker option from the Add-In menu. Example of the Standards Checker Add-in window The drop-down list contains a list of all of the components of the currently loaded Visual Basic project (.BAS,.CLS and.frm files). To check all components, select the (All Components) item and click the Proceed (green arrow) button. If a specific component is selected, only that component will be checked when clicking the Proceed button. Under the components drop-down list, there is a list box used for displaying errors and warnings for the specific components. The list box will not display errors if the (All Components) item is selected. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 65

Options Click the Options button to change the options available when checking a project. Example of the Standards Checker Options window Controls Project Type Select the type of project you are checking. Maintenance/Processing projects have different requirements than Report projects. If the Standards Checker has the correct project type, the check will be more complete. Main Form Module This is the project s main form module. Certain standards apply only to the main form, so it is important that the correct form is selected. The Standards Checker tries to determine the standard form automatically. If it selects the wrong form, you can manually select the correct one here. Main Class Module This is the project s main class module. As with the form module, certain checks apply only to the main class module. The Standards Checker tries to determine the standard class module automatically. If it selects the wrong class, you can manually select the correct one here. Check For You can check what standards are scanned for when checking your project. Un-rigged Code - This option looks for code that has not been rigged with the VB/Rig utility. Note that a procedure is considered "rigged" if the first line after the procedure definition is a VB/Rig signature (a line beginning with '+++ VB/Rig'). If no such line exists, or if the rig line is not the first line after the procedure definition, the procedure is considered to be un-rigged. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 66

Function Name Prefixes - This option ensures the prefix of the function matches the value returned from the function. For example, string functions should be prefixed by 's' and boolean functions by 'b.' Functions that begin with the letter 'g' are considered global functions and the prefix is determined by the second character of the function name (for example, gsformatdatetodb is looked at as 'sformatdatetodb' and thus should return a string). Un-localized Messages - For portability, all messages should be localized and use the gisotamsgbox function. This option checks for the use of the VB MsgBox command to find un-localized messages. Help ID Assignment - This option will raise an error if a control on a form is supposed to have a Help ID assigned, but its current 'WhatsThisHelpID' is zero. Customizer Code - This option checks if your project has had the customizer code and controls added to it. It will also make sure the controls have the correct properties -- specifically, Visible and Enabled should be False. Web Reports Code - This option checks if your project has had the web reporting code added to it. This option is available only when checking reports. Only Check Local Files This option speeds the checking process by only looking at local files. A local file is defined as any file that resides in the same directory as the.vbp file. Files in different module-level directories and those in COMMON are not checked for standards compliance if this option is selected. Show Only Errors To only show errors, select this option. If this option is not selected, both errors and warnings are displayed when viewing the results for a particular component. Error Display After performing a check, select a component from the drop-down list to view any errors/warnings generated. Example of the Standards Checker Add-in window In the window shown above, the form, frmprestoreportdlls, has numerous standards violations. With most code errors, you can double-click the error and a code window will open and highlight the offending code. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 67

Maintain Report Sort Selection Information Introduction The Maintain Report Sort Selection Information utility is used to maintain the sort selection criteria for selection grids in reports, listings, and inquiries. Because of a change in the caching methods of SQL Server 7.0 and 2000, the sort order of information extracted from the data dictionary fluctuates. The design of the report infrastructure requires that the order of the information be consistent. When the order is not consistent, unexpected results or errors may occur. To handle this issue, a new table has been created to control the sort order of the data dictionary information used by the sort and selection grids. This table, tsmrptsortselctrl is considered a static table that is populated during the development process. Sage does not support any changes made to tsmrptsortselctrl; however, third-party developers may need to change the contents for newly created reports and inquiries or for existing reports and inquiries that have been modified. Using the Utility The MaintainRptSortSel.exe utility is located in the \Utilities folder under your Sage ERP MAS 500 SDK installation folder. When you double-click the executable, the following window appears. In the Program Information section, enter the exe or dll name of the program that makes the call to IDDBuildData (usually found in linitializereport). Do not include the path or file extension. In the Table Name section, enter the names of the tables in the same order they are added to the srealtablecollection in the program (usually found in form_load). S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 68

Creating Records From the File menu, select Create Rows. If records do not exist, they are created for the combination of executable name and list of tables entered. The created records are displayed in the Sort Selection Information grid. If records already exist, you can choose to reset (existing records are deleted and new records are created) or to display the existing records. Editing Records From the File menu, select Edit Rows. Make changes to the sort order in the SeqNo column. Click Save to insert the revised information into the database. Removing Records You can remove records by deleting or resetting. Deleting records causes the information based on the combination of executable name and list of tables to be deleted. To delete records, select Delete Rows from the File menu. Resetting records deletes the existing records and creates new ones based on the combination of executable name and list of tables. To delete records and create new ones, select Reset Rows from the File menu. Building SQL Insert Files Records must first exist before you can build SQL insert files. From the File menu, select Build SQL Inserts. You are prompted for the location and file name for the insert statements. S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 69

S AGE ERP MAS 500 SDK DEVELOPMENT UTILITIES GUIDE 70