Tutorial 25 - Transaction Procedures - Extra Templates

This is a continuation of the process of configuring Transaction Procedures. Due to the inclusion of the Subledger field and the Account Name View field in the Common Template, the Procedures associated with the Common Template have to be replicated for the Extra Templates.

For the sake of giving you "exposure/experience" we are taking you the more labor intensive route (i.e. we made you complete all the Templates first (e.g. including Cloning) before configuring the Procedures). In real-life, you will create a Template followed by the Procedure; then, when you Clone or Save As/To, you will be cloning or copying the Procedures as well (subject to any necessary modifications).

In addition to replicating the Common Procedures, you need to configure Procedures that are specific to certain Transaction Templates.



Exercise 25 - 1, Configuring a Saving record Procedure for the MERCH Template
You will set up a Procedure that upon saving a record, where the Amount is positive and the GL number is 120, will set the Recalculate switch to YES (checked) in the Invent Global table for the matching Product Code.

1. Launch the Transaction Procedures editor and select the Procedure > Open menu item.
2. Select MERCH > Saving record from the Open Procedure panel and configure this Procedure:
When giving the specifications for the Update object, select the Database Source first, then the Database Field, finally click-select the Value field and make it editable by clicking on the Run-time button and type Yes.



Exercise 25 - 2, Configuring Saving record Procedures for the AR and AP Templates
This Procedure makes use of the DocText User Function which you created as part of Tutorial 21. You will first configure this Procedure for the AR Template and then use Copy/Paste to replicate it for the AP Template.

1. Select AR > Saving record from the Open Procedure panel and configure this Procedure. Test, Save but do not Close.

2. Select AP > Saving record from the Open Procedure panel and replicate the Procedure:
Remove the Finish object and move the Start object to the left in the AP Workspace.
Rubber-band all objects (excluding the Start object) in the AR Workspace and click on the Copy button.
Click on the AP Workspace and click on the Paste button.
Connect the Start object. Test and Save.



Exercise 25 - 3, Configurating and Replicating the Document Date Procedure
Two Transaction Templates contain the Due Date field. They are Accounts Receivable (AR) and Accounts Payable (AP). The Due Date will be calculated through a Procedure triggered by the Document Date field according to these rules:
In Accounts Receivable
a transaction with a positive amount is a Primary record and the Due Date is equal to the Document Date plus the number of days according to which Credit is granted to a Customer; and
a transaction with a negative amount is a Secondary record and the Due Date is equal to the Document Date.
In Accounts Payable
a transaction with a negative amount is a Primary record and the Due Date is equal to the Document Date plus the number of days according to which Credit is granted by a Vendor; and
a transaction with a positive amount is a Secondary record and the Due Date is equal to the Document Date.

1. Configure the following Procedure. The Inspector settings for the Trade Retrieval are:
Retrieval: Single row
Search: Numeric ID = Customer
GL Account = GL
GL Prefix = Prefix

2. Now replicate the AR Document Date Procedure as the AP Document Date Procedure:
Select AP > Document Date and the Procedure > Copy from... menu item.
Select AR > Document Date.
Click on the Condition object and change from Amount >= 0.00 to Amount <= 0.00.



Exercise 25 - 4, Replicating Procedures that are common to all Templates
You will be replicating Procedures using the Document > Copy from... menu option and Copy/Paste. To do so, launch the Transaction Procedure editor.

1. Select AR > Prefix from the Open Procedure panel.
Select the Procedure > Copy from... menu item.
Select Common > Prefix from the Copy Procedure from panel.
This will load Prefix Procedure attached to the Common Template into the Prefix Procedure Workspace of the AR Template.
Test and Save the Procedure.

Please note: you will now repeat the process for other Procedures, but with fewer explanations.


2. Select AR > GL and the Procedure > Copy from... menu item.
Select Common > GL.
Test and Save.


3. Select AR > Description and the Procedure > Copy from... menu item.
Select Common > Description.
In the Calculation box replace the User Name of Field #8 (Subledger) with Customer and the Misc.Description with Trade.[Last or Corporate Name].
Replace the first Misc Retrieval with Trade and Get Field: Last or Corporate Name and Numeric ID. The Inspector settings for the Trade Retrieval are:
Retrieval: Multiple rows (all), Stop and show switch is ON.
Search: Last or Corporate Name Like CIString
GL Account = GL
GL Prefix = Prefix
Remove the second Misc Retrieval loop and one of the Exit/Finish objects; reposition the Calculation object and connect the execution flow per example.
Test and Save the Procedure.

4. Select AR > Customer and the Procedure > Copy from... menu item.
Select Common > Subledger.
Replace the Misc Retrieval with Trade and Get Field: Last or Corporate Name. Inspector settings:
Retrieval: Single row
Search: Numeric ID = Customer
GL Account = GL, GL Prefix = Prefix.
Test and Save the Procedure.


5. Select AR > Loading record from the Open Procedure panel.
Please Note: Copy from... is only available for field-based Procedures. However, since the Loading record Procedure is almost identical to the Procedure triggered by the Customer field, you can use the copy/paste routine.
Select AR > Customer from the Open Procedure panel.
Rubber-band (select) all objects, except Start and Finish, in the Customer Procedure and Copy.
Move the Start object to the left in the Loading record Procedure Workspace, click on the Workspace's background and Paste.
Remove Description = Trade.[Last or Corporate Name]; from the Calculation box and connect the objects (i.e. Start and Finish).
Save the Procedure (you can't test this Procedure until you have Transaction data saved).


Next you will be repeating this replication process for the AP Template. One of the fields in this Template does not have the same User name as the AR Template; therefore, a modification is required in the AP Procedure (Vendor instead of Customer). Since you are learning as you go, the following instructions will be more cryptic.

6. Select AP > Prefix.
Copy from AR > Prefix.
Test and Save the Procedure.
Select AP > GL.
Copy from AR > GL.
Test and Save.
Select AP > Description.
Copy from AR > Description.
In the Calculation box replace Customer with Vendor.
Test and Save the Procedure.
Select AP > Vendor.
Copy from AR > Customer.
Set the Trade Retrieval Inspector as:
Search: GL Account = 308
GL Prefix = 1.
Test and Save the Procedure.
Select AP > Loading record.
Select AP > Vendor.
Copy required objects from the Vendor Procedure, and Paste into Loading record Procedure.
Remove Description = Trade.[Last or Corporate Name]; from the Calculation box and connect the objects (i.e. Start and Finish).
Save the Procedure (you can't test this Procedure until Transaction records have been saved).


Next you will be repeating this replication process for the MERCH Template. One of the fields in this Template does not have the same User name as the AR Template; therefore, a modification is required in the MERCH Procedure (Product instead of Customer).

7. Select MERCH > Prefix.
Copy from AR > Prefix.
Test and Save the Procedure.
Select MERCH > GL.
Copy from AR > GL.
Test and Save.
Select MERCH > Description.
Copy from AR > Description.
Replace Trade Retrieval of Last or Corporate Name with Product Name Retrieval from Stock.
Set the Stock Retrieval Inspector as:
Search: Product Name Like CIString
GL Account = GL
GL Prefix = Prefix
In the Calculation box replace Trade.[Last or Corporate Name] with Stock.[Product name] and Customer = Trade.[Last or Corporate Name] with Product = Stock.[Product name].
Set second Exit Inspector setting to advance to Qty.
Test and Save the Procedure.
Select MERCH > Product.
Copy from AR > Customer.
Replace Trade Retrieval of Last or Corporate Name with Product Name Retrieval from Stock.
Set the Stock Retrieval Inspector as:
Search: Product Code = Product
GL Account = GL
GL Prefix = Prefix
In the Calculation box replace Trade.[Last or Corporate Name] with Stock.[Product Name].
Set Exit Inspector setting to advance to Qty.
Test and Save the Procedure.
Select MERCH > Loading record.
Select MERCH > Vendor.
Copy required objects from the MERCH Procedure, and Paste into Loading record Procedure.
Remove Description = Stock.[Product Name]; from the Calculation box and connect the objects (i.e. Start and Finish).
Save the Procedure (you can't test this Procedure until Transaction records have been saved).


Go To
  Tutorial 26 - Building a set of Print Templates and a Procedure (to print an Account Chart)
  Index