Docstoc

Dexterity Training Handouts

Document Sample
Dexterity Training Handouts Powered By Docstoc
					Dexterity Development Notes

Useful Scripts
The following code segment can be used to identify the type of Dynamics 6.00 or below system being currently used.

        local string l_platform.
        if 'SQL Server' of globals > 0 then
                if 'SQL Server' of globals = EENTERPRISESQL then
                        l_platform = "eEnterprise".
                else
                        l_platform = "Dynamics SQL".
                end if.
        else
                l_platform = "Dynamics".
        end if.



The following code segment can be used to set the Dictionary ID, so that palette and security type records will point to
the Dynamics dictionary when in Test mode and to the Third party dictionary in runtime mode.

        { PROD_ID is a constant containing the Dictionary’s Product ID }
        local integer l_AltDictID.

        { Check to see whether chunk is installed. }
        l_AltDictID = DYNAMICS.
        if not empty(Launch_GetFileName()) then
                if Launch_GetProdPosition(PROD_ID) > 0 then
                        l_AltDictID = PROD_ID.
                end if.
        end if.



Improving RW Function Performance
If using user defined report writer functions (i.e. a normal function with a name prefixed with RW_) in your reports you
may experience a performance loss, especially if the RW Function is used in the body and opens a table not attached
directly to the report. The reason is that the table will be opened and closed for each body record. If the table can be
opened once and then closed when the report is finished you will have significant performance enhancements. Below
is a technique (slightly different from the Great Plains recommended technique) which will achieve this:-

1. Create a Form with no windows and attach the appropriate table(s) to it. Using the Options button make sure that
   table is set to Open during Form Open.

2. Create a Form Procedure called “Close” with the following script: close form form_name.

3. Add the following FORM_PRE script: call background Close of form form_name.

4. Add the following lines at the beginning of the RW Function:-

    if not isopen(form form_name) then
       open form form_name.
    end if.

All reports run in the background and background processing is queued on a First In First Out (FIFO) basis. This
means that any request to process in the background after a report has started will not execute until the report has
finished. The RW Function will open the form, which will automatically close as soon as the report has completed.
Because the form opens the tables on form open, the tables will be held open and Dexterity will be fast to access data
from those tables. If the form closes early for any reason, the RW Function will open it again automatically.




Dexterity Development Notes                                                                                         1
Useful Download Site
Please visit ftp://ftp.greatplains.com/tools_select for additional resources for Dexterity and other products in the
DynamicTools range. Also available from this site are all the released versions of Dexterity. If you have access to
PartnerSource, you can access the DynamicTools Download site through http://www.GreatPlains.com/PartnerSource
and choose the Developer button at the top of the page. Then choose Support and Downloads.

Useful DEX.INI settings
Below are settings that can be used to change the behaviour of Dexterity, Dynamics or both, add them to the DEX.INI
file in the C:\DYNAMICS or C:\DEXTERITY directories.

SQLLogSQLStmt=TRUE                     Dex & Dyn    Log SQL statements being sent to SQL Server to DEX.SQL file.
SQLLogODBCMessages=TRUE                Dex & Dyn    Log ODBC messages returned from SQL Server to DEX.SQL file.
ScriptDebugger=TRUE                    Dyn          Turn Script Debugger Features on in Runtime Mode.
ScriptDebuggerProduct=<PROD ID>        Dyn          Specify Product ID of product to be debugged.
ShowAdvancedMacroMenu=TRUE             Dex & Dyn    Display additional menu under Tools->Macro.
SuppressSound=TRUE                     Dex & Dyn    Stop Dexterity and Dynamics generating any sounds.
ResourceExplorer=TRUE                  Dex          Activate Resource Explorer in Dexterity V5.0 or V5.5.
CompilerWarningLevel=2                 Dex          Disable Literal String Compile Time Warnings.
UIFieldBorderSystem=TRUE               Dex & Dyn    Needed for new 6.0 UI format for Text Prompts.
UIPromptUnderline=TRUE                 Dex & Dyn    Needed for new 6.0 UI format for Text Prompts.
AdvLookups=FALSE                       Dyn          Creates new users without setting security to Advanced Lookups.
DevAssistShow=TRUE                     Dex          Show the Developers Assistant after logging in.

Multi-programmer Development (pre 6.00)
When multiple programmers need to simultaneously work on the same Dexterity Development application,
procedures need to be put into place to ensure that the development runs smoothly. Dexterity is a single user
development environment, so each programmer must work in a duplicate of the development dictionary. The
procedures allow all the new code from each developer to be combined into a Master development dictionary. The
terminology used is explained in the section following called “Client vs. Developer System”. Below are the steps:-

1. Assign one programmer as the owner of the Master development dictionary. This PROD_DYN.DIC will be the
   only one used to create the installable chunk. All other programmers only have their own PROD_DYN.DIC that
   they work on. NB: The Master Dictionary should be only dictionary used when creating alternate forms and
   reports by modifying original Dynamics forms and reports.

2. At the beginning of a session (one day or until the appropriate work is completed), the Master version of the
   PROD_DYN.DIC is copied to all other programmers.

3. While working on the code, all programmers must record any resources (form, report, procedure etc.) that they
   create or modify. If the resource is likely to be shared, confirm that no other programmer has modified it.

4. Once each individual PROD_DYN.DIC is ready, then use Dexterity Utilities to Transfer Resources to the Master
   Dictionary, ie from a secondary PROD_DYN.DIC to the Master PROD_DYN.DIC. Resources will be given the
   same resource ID if it is available or the resources will be renumbered as required. The lists made in step 3 are
   used to identify what to transfer. You must make sure that you do not overwrite anything that more than one
   developer has changed. If this occurs you must manually remake the changes in the Master dictionary.
   Compiling is optional here as we are going to re-compile everything in the next step.

5. Using Dexterity Utilities (set series to All), Compile all global functions and procedures. Then Compile all the
   forms that you have developed, you should be prefixing your forms, reports and tables (e.g. WDC_ for Winthrop
   Dexterity Consultants) so they will all be grouped together. Compiling will identify errors as well as adjust for any
   resources referenced that have had their number changed.

6. Create your chunk from the Master Dictionary.

7. Copy the Master Dictionary elsewhere as a backup and distribute the new version to all the developers. Back to
   step 2.

Dexterity Development Notes                                                                                         2
Programming for SQL Server
Below are the most important considerations when programming a Dexterity Application to run in a SQL Server
environment.

•   You must not attempt to access SQL tables before the Dynamics Login has occurred. If you need access prior to
    this stage you must use local c-tree tables.

•   You cannot easily access tables in other companies, so if you need to access data from more than one company
    in one of your tables ensure that it belongs to the System series.

•   Tables must be created explicitly before use. C-tree and Btrieve systems will automatically create a table on the
    first reference, but SQL tables must be created explicitly while logged in as “sa”.

The following Global Procedure, which can be called from an Install window is an example of how to create tables in a
SQL environment. Please note that you must grant access after the table is created, by using GRANT.SQL
provided by Great Plains or some other method (such as “pass through SQL”).

        local boolean l_flag.
        if 'SQLSaUser' of globals then
              { SQL Tables can only be created when logged in as "sa" }
              l_flag = Table_SetCreateMode(true). {Turns on create ability}
              open table table_name.
              close table table_name.
              l_flag = Table_SetCreateMode(false).
        end if.


Dexterity Launch File
Below are example Dexterity Launch files for the Dynamics system described on the next page. Before installing
PRODUCT.CNK chunk file:-

        1
        0
        Dynamics
        Windows
        :C:DYNAMICS/DYNAMICS.DIC
        :C:DYNAMICS/FORMS.DIC
        :C:DYNAMICS/REPORTS.DIC

After installing PRODUCT.CNK chunk file:-

        2
        0
        Dynamics
        32000
        Third Party Product
        Windows
        :C:DYNAMICS/DYNAMICS.DIC
        :C:DYNAMICS/FORMS.DIC
        :C:DYNAMICS/REPORTS.DIC
        :C:DYNAMICS/PRODUCT.DIC
        :C:DYNAMICS/PROD_FRM.DIC
        :C:DYNAMICS/PROD_RPT.DIC

The first line is the number of products, followed by 2 lines for each product with the Product or Dictionary ID and the
Product Name. Then for each Workstation type (usually Windows or Macintosh) will be a heading followed by 3 lines
for each product. The 3 lines contain the Generic Pathname for the Application, Custom Form and Custom Report
dictionaries.




Dexterity Development Notes                                                                                         3
Client vs. Developer System
        Client System (C:\DYNAMICS Directory)                                                     Developer System (C:\DEXTERITY\PRODUCT Directory)

                                           Runtime

                                      DYNAMICS.EXE                                                PROD_DYN.DIC
                                                                              Copy &
                                         Runtime Engine                       Rename                                                           PRODUCT.DIC
                                                                                                                           Extract
                                                                                                  Resources >= 22000
                                                                                                                                                   with source
                                      DYNAMICS.SET
                                                                                                                                                Alternate Forms
                                           Launch File                                                          Transfer Dictionary Module &
              Modifier                                               Report Writer                               Update Series Resources        Alternate Reports

            FORMS.DIC                  DYNAMICS.DIC                  REPORTS.DIC                                           Product             Product Information
                                                                                                                         Information
                                          Product ID: 0

                                                                                                                                                 Auto Chunk
         PROD_FRM.DIC                  PRODUCT.DIC                  PROD_RPT.DIC
                                        Product ID: 32000
                                                                                                                                               PRODUCT.CNK
                                                                                                     Copy into Dynamics Directory
                                                                                                       & Launch Dynamics                           No source

Client System
DYNAMICS.EXE                  Dexterity Runtime Application (also called RUNTIME.EXE in the Dexterity Directory)
DYNAMICS.SET                  Dexterity Launch File for Dynamics
DYNAMICS.DIC                  Dynamics Application Dictionary (No source)
FORMS.DIC                     Dynamics User Modified Forms (created with Modifier)
REPORT.DIC                    Dynamics User Modified Reports (created with Report Writer)
PRODUCT.DIC                   Third Party Developer Application Dictionary (No source)
PROD_FRM.DIC                  Third Party User Modified Forms (created with Modifier)
PROD_RPT.DIC                  Third Party User Modified Reports (created with Report Writer)

Developer System
PROD_DYN.DIC                  Renamed copy of DYNAMICS.DIC with additional Resources added with Dexterity (contains third party source only)
PRODUCT.DIC                   Extracted Dictionary with transferred alternate Dynamics forms and reports (contains third party source only)
PRODUCT.CNK                   Dexterity Chunk File created from PRODUCT.DIC using Auto Chunk
PRODUCT.MAC                   Macro recorded to speed up Extraction and Chunking process
RUNTIME.EXE                   Dexterity Runtime Application (also called DYNAMICS.EXE in the Dynamics Directory)

Prepared by David Musgrave of Winthrop Dexterity Consultants Pty Ltd (last updated: 4-Feb-2001)


Dexterity Development Notes                                                                                                                                          4

				
DOCUMENT INFO
Shared By:
Stats:
views:347
posted:2/2/2010
language:English
pages:4
Description: Dexterity Training Handouts