Tutorial 22 - Subledger Procedures

Procedures are executable flow-charts that are used for a variety of purposes in STEP FORWARD. In this Tutorial you will learn how Procedures can add functionality and data entry efficiencies to the Subledger Templates that you created as part of Tutorial 11.

Each Template can have a number of Procedures which are executed (triggered) during Data Entry, based upon the following trigger criteria:

Template-based e.g. saving a record;
Field-based i.e. disturbing any field directly, or indirectly, with protective override;
Trigger-based i.e. a View field defined as a button or a pop-up list.

You learned about the configuration of Procedures in previous Tutorials (e.g. #5); therefore, we will keep the explanations to an absolute minimum.



Exercise 22 - 1, New record Procedure (Template-based) for Trade Template
This procedure will determine whether the loaded Input Template (based upon prior usage or a selection made by pressing the Set GL account button) is for Accounts Receivable or Accounts Payable and insert either an AR or an AP into the Trade Account field.

  

Please Note:
CNTRL_GL_NUMBER and CNTRL_GL_PREFIX are system-defined variables that are automatically set to the currently used GL Number and GL Prefix. Their contents can be interrogated at any time, as done in this Procedure.


Exercise 22 - 2, Saving record Procedure (Template-based) for Trade Template
This Procedure is aborted if the record being saved is not a "New Record." For New Records, the Procedure:
retrieves the Record Id of the source record in the Global (Names) table (Single row retrieval, Search: Numeric Id of Source record = Numeric Id of the active (Trade) record);
determines whether Trade Account value of the active record == AR; if not, it assumes AP;
either way it Updates the Status in the Names table.

Please Note:
NEW_RECORD is a system-defined variable that carries a YES or NO flag that is set according to the state of the Data Entry Option pop-up list which is located between the data entry and record browser area of the Data Entry window.


Exercise 22 - 3, Deleting record Procedure (Template-based) for Trade Template
Look at the Calculation objects. This is essentially a Rollback Procedure which will Update the Status in the Names table when a Subledger is being deleted. However, Subledgers can't be deleted if the database contains transactions pertaining to a given Subledger.


Exercise 22 - 4, Payment Method related Procedures (Field-based) for Trade Template
The Trade Template contains a pop-up list with four options: Terms, PAP (pre-authorized payment plan), Visa, and MasterCard - in addition to the default setting of Select One.

The next few Procedures are triggered by specific fields that deal with the Payment Method options i.e. PAP requires three data fields (Institution, Transit, and Account) and for Credit Card payments two data fields (Number and Expires). We have made the arbitrary decision that unless Terms are granted all accounts are C.O.D.and payable via PAP or Credit Card. These Procedures are designed to enforce these guidelines and the consistency of data (e.g. a record with the PAP Payment Method must have banking information but not Credit Card data).

1. Launch the General Data Entry function and select the Terms table from the Global section of the Open Table panel.
Enter these records listed in this order: Terms Code, Terms Description, Net Days, Discount Days, and Discount Rate:
1 C.O.D. - pay immediately 0 0 0.00
2 Net 30 days 30 0 0.00
3 Net 25 days 25 0 0.00
4 Net 30, 2%10 days 30 10 2.00

2. Create a Procedure, triggered by the Institution field for the Trade Subledger Template:
launch the Subledger Procedures editor (in the event that you Quit it after Exercise 22-3);
select the Procedure > Open menu item;
select Trade -> Institution from the Open Procedure panel;
create this Procedure:

Please note Exit Inspector settings (all five are Select field from the list below)
1 = Transit; 2 = Number; 3 = Number; 4 = Transit; 5 = Code.

3. Create a Procedure, triggered by the Transit field for the Trade Subledger Template:
select the Procedure > Open menu item;
select Trade -> Transit from the Open Procedure panel;
select Procedure > Copy from... menu item;
select Trade -> Institution from the Copy Procedure from panel;
This will copy the exact same Procedure as you just created for the Institution field trigger.
Exit Inspector settings for Exits 1 and 4 should be Account.

4. Create a Procedure, triggered by the Accounts field for the Trade Subledger Template:
select the Procedure > Open menu item;
select Trade -> Accounts from the Open Procedure panel.
select Procedure > Copy from... menu item;
select Trade -> Institution from the Copy Procedure from panel;
This will copy the exact same Procedure as you just created for the Institution field trigger.
Exit Inspector settings for Exits 1 and 4 should be Code.

5. Create a Procedure, triggered by the Number field for the Trade Subledger Template:
select the Procedure > Open menu item;
select Trade -> Number from the Open Procedure panel.
select Procedure > Copy from... menu item;
select Trade -> Institution from the Copy Procedure from panel;
This will copy the exact same Procedure as you just created for the Institution field trigger. Modify the Procedure to accommodate the CheckDigit10 System Function and related objects. The additional Exit Inspector setting should return the Cursor to the Number field. The Exit Inspector settings for Exits 1 and 4 should be Expires.
Create this Procedure:

6. Create a Procedure, triggered by the Expires field for the Trade Subledger Template:
select the Procedure > Open menu item;
select Trade -> Number from the Open Procedure panel.
select Procedure > Copy from... menu item;
select Trade -> Number from the Copy Procedure from panel.
This will copy the exact same Procedure as you just created for the Number field trigger. Modify the Procedure to accommodate the ExpiresMonthEnd User Function and related objects (watch the Yes / No orientation of the Condition object, switch it in the Condition Inspector). The additional Exit Inspector setting should return the Cursor to the Number field. The Exit Inspector settings for Exits 1 and 4 should be Code.
Create this Procedure:


7. Create a Procedure, triggered by the Payment Method field for the Trade Subledger Template:
select the Procedure > Open menu item;
select Trade -> Payment Method from the Open Procedure panel.
Create this Procedure:



Go To
  Tutorial 23 - Updating Subledgers
  Index