List of Use Cases Implemented by the AR915P Call Stack¶
The AR915P program, along with its called programs AR915 and AR9154, implements the following use case within the Customer Master Information system:
- Manage Customer Form Type Contacts:
- Description: This use case allows users to view, create, update, delete, or restore customer form type contact records. It provides an interactive interface to manage contact details (e.g., form type, contact name, email, flags) for a specific company and customer, supporting both maintenance (
MNT) and inquiry (INQ) modes. - Components:
AR915P: Displays a subfile listing contact records, allowing users to select records for viewing, updating, deleting, or creating new ones.AR915: Handles the creation or update of a single contact record, with validation of form type, contact name, email, and flags.AR9154: Manages the deletion or restoration of a contact record via a confirmation window.
This is the primary use case, as the programs are tightly integrated to manage customer form type contacts comprehensively.
Function Requirement Document: Manage Customer Form Type Contacts¶
Function Requirement Document: Manage Customer Form Type Contacts¶
Purpose¶
The Manage Customer Form Type Contacts function allows the system to retrieve, create, update, delete, or restore customer form type contact records for a specified company and customer without interactive screen input. It processes input parameters to perform the requested operation and returns a status flag to indicate success or failure.
Inputs¶
- Company Code (
cono): 2-character code identifying the company (required). - Customer Code (
cust): Customer identifier (required). - Sequence Number (
seq#): Numeric identifier for the contact record; 0 for new records (required). - Mode (
mode): Operation mode, eitherMNT(maintenance) orINQ(inquiry) (required). - File Group (
fgrp): File group identifier,ZorG, for database overrides (required). - Operation (
oper): Action to perform:CREATE,UPDATE,DELETE,RESTORE, orVIEW(required). - Form Type Code (
fmty): Code for the form type (required forCREATE,UPDATE). - Contact Name (
cntc): Name of the contact person (required forCREATE,UPDATE). - Email Address (
emla): Email address for the contact (optional forCREATE,UPDATEiffmyn = 'N'). - Send Original Flag (
fmyn):YorN, indicates if the original form is sent (required forCREATE,UPDATE). - Send Reprint Flag (
rpyn):YorN, indicates if reprints are sent (required forCREATE,UPDATE). - Send by Mail Flag (
mlyn):YorN, indicates if sent by mail (required forCREATE,UPDATE). - Send Back Terms Flag (
bkyn):YorN, indicates if back terms are sent (required forCREATE,UPDATE).
Outputs¶
- Return Flag (
flag): Status indicator: 1: Successful creation or update.D: Successful deletion.A: Successful restoration.E: Error (e.g., validation failure or record not found).- Error Message (
errmsg): Description of any error encountered (e.g., "Invalid form type code").
Process Steps¶
- Validate Inputs:
- Verify
conoexists inbicontand is not deleted; else, returnflag = 'E',errmsg = "Invalid company code". - Verify
custexists inarcustand is not deleted; else, returnflag = 'E',errmsg = "Invalid customer code". - For
CREATE,UPDATE:- Verify
fmtyexists ingstablwith typeFRMTYPand is not deleted; else, returnflag = 'E',errmsg = "Invalid form type code". - Verify
cntcis non-blank; else, returnflag = 'E',errmsg = "Contact name required". - If
emlais non-blank, validate viaVALMAILID; if invalid, returnflag = 'E',errmsg = "Invalid email address". - If
fmyn = 'Y'or blank,emlamust be non-blank; else, returnflag = 'E',errmsg = "Email address required". - Verify
fmyn,rpyn,mlyn,bkynareYorN; else, returnflag = 'E',errmsg = "Invalid flag value".
- Verify
-
For
UPDATE,DELETE,RESTORE,VIEW, verifyseq#exists inarcufmusingconoandseq#; else, returnflag = 'E',errmsg = "Record not found". -
Apply File Overrides:
-
Use
fgrp(ZorG) to override database files (arcust,bicont,arcufm,gstabl) to the appropriate library (e.g.,garcustorzarcust). -
Process Operation:
- VIEW:
- Retrieve record from
arcufmusingconoandseq#. - Return record fields (
fmty,cntc,emla,fmyn,rpyn,mlyn,bkyn,del) andflag = '1'.
- Retrieve record from
- CREATE:
- If
seq# = 0, retrieve next sequence number frombicont.bcseqn, increment until unique inarcufm, and updatebicont.bcseqn. - Create new
arcufmrecord withcono,seq#,cust,fmty,cntc,emla,fmyn,rpyn,mlyn,bkyn, anddel = 'A'. - Set
flag = '1'.
- If
- UPDATE:
- Update existing
arcufmrecord with providedfmty,cntc,emla,fmyn,rpyn,mlyn,bkyn, retainingdelstatus. - Set
flag = '1'.
- Update existing
- DELETE:
- If
del != 'D', updatearcufmrecord to setdel = 'D'. - Set
flag = 'D'.
- If
-
RESTORE:
- If
del = 'D', updatearcufmrecord to setdel = 'A'. - Set
flag = 'A'.
- If
-
Return Results:
- Return
flaganderrmsg(if applicable). - For
VIEW, include retrieved record fields.
Business Rules¶
- Company and Customer Validation:
conomust exist inbicontand not be deleted.-
custmust exist inarcustand not be deleted. -
Form Type Validation:
-
fmtymust exist ingstablwith typeFRMTYPand not be deleted. -
Contact Name:
-
cntcmust be non-blank forCREATEandUPDATE. -
Email Validation:
- If
emlais provided, it must be valid perVALMAILID. -
emlais optional iffmyn = 'N'; otherwise, it is required forCREATEandUPDATE. -
Flag Validation:
-
fmyn,rpyn,mlyn,bkynmust beYorN. -
Sequence Number for CREATE:
-
If
seq# = 0, generate a unique sequence number by incrementingbicont.bcseqnuntil no conflict exists inarcufm. -
Deletion and Restoration:
- Deletion sets
del = 'D'only if the record is active (del != 'D'). -
Restoration sets
del = 'A'only if the record is deleted (del = 'D'). -
Inquiry Mode:
- In
INQmode, onlyVIEWoperation is allowed; no database updates occur.
Calculations¶
- Sequence Number Generation:
- Retrieve
bcseqnfrombicontfor the givencono. - Increment
bcseqnand checkarcufmfor uniqueness usingconoandseq#. - Repeat until a unique
seq#is found, then updatebicont.bcseqn.
Database Tables¶
- arcust: Validates customer code (
cust) and retrieves customer name. - bicont: Validates company code (
cono), retrieves company name, and manages sequence numbers (bcseqn). - arcufm: Stores contact records; used for retrieval, creation, update, deletion, or restoration.
- gstabl: Validates form type code (
fmty) with typeFRMTYP.
External Programs¶
- VALMAILID: Validates email addresses for
CREATEandUPDATEoperations. - QCMDEXC: Applies file overrides based on
fgrp.