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,Z
orG
, 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
,UPDATE
iffmyn = 'N'
). - Send Original Flag (
fmyn
):Y
orN
, indicates if the original form is sent (required forCREATE
,UPDATE
). - Send Reprint Flag (
rpyn
):Y
orN
, indicates if reprints are sent (required forCREATE
,UPDATE
). - Send by Mail Flag (
mlyn
):Y
orN
, indicates if sent by mail (required forCREATE
,UPDATE
). - Send Back Terms Flag (
bkyn
):Y
orN
, 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
cono
exists inbicont
and is not deleted; else, returnflag = 'E'
,errmsg = "Invalid company code"
. - Verify
cust
exists inarcust
and is not deleted; else, returnflag = 'E'
,errmsg = "Invalid customer code"
. - For
CREATE
,UPDATE
:- Verify
fmty
exists ingstabl
with typeFRMTYP
and is not deleted; else, returnflag = 'E'
,errmsg = "Invalid form type code"
. - Verify
cntc
is non-blank; else, returnflag = 'E'
,errmsg = "Contact name required"
. - If
emla
is non-blank, validate viaVALMAILID
; if invalid, returnflag = 'E'
,errmsg = "Invalid email address"
. - If
fmyn = 'Y'
or blank,emla
must be non-blank; else, returnflag = 'E'
,errmsg = "Email address required"
. - Verify
fmyn
,rpyn
,mlyn
,bkyn
areY
orN
; else, returnflag = 'E'
,errmsg = "Invalid flag value"
.
- Verify
-
For
UPDATE
,DELETE
,RESTORE
,VIEW
, verifyseq#
exists inarcufm
usingcono
andseq#
; else, returnflag = 'E'
,errmsg = "Record not found"
. -
Apply File Overrides:
-
Use
fgrp
(Z
orG
) to override database files (arcust
,bicont
,arcufm
,gstabl
) to the appropriate library (e.g.,garcust
orzarcust
). -
Process Operation:
- VIEW:
- Retrieve record from
arcufm
usingcono
andseq#
. - 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
arcufm
record withcono
,seq#
,cust
,fmty
,cntc
,emla
,fmyn
,rpyn
,mlyn
,bkyn
, anddel = 'A'
. - Set
flag = '1'
.
- If
- UPDATE:
- Update existing
arcufm
record with providedfmty
,cntc
,emla
,fmyn
,rpyn
,mlyn
,bkyn
, retainingdel
status. - Set
flag = '1'
.
- Update existing
- DELETE:
- If
del != 'D'
, updatearcufm
record to setdel = 'D'
. - Set
flag = 'D'
.
- If
-
RESTORE:
- If
del = 'D'
, updatearcufm
record to setdel = 'A'
. - Set
flag = 'A'
.
- If
-
Return Results:
- Return
flag
anderrmsg
(if applicable). - For
VIEW
, include retrieved record fields.
Business Rules¶
- Company and Customer Validation:
cono
must exist inbicont
and not be deleted.-
cust
must exist inarcust
and not be deleted. -
Form Type Validation:
-
fmty
must exist ingstabl
with typeFRMTYP
and not be deleted. -
Contact Name:
-
cntc
must be non-blank forCREATE
andUPDATE
. -
Email Validation:
- If
emla
is provided, it must be valid perVALMAILID
. -
emla
is optional iffmyn = 'N'
; otherwise, it is required forCREATE
andUPDATE
. -
Flag Validation:
-
fmyn
,rpyn
,mlyn
,bkyn
must beY
orN
. -
Sequence Number for CREATE:
-
If
seq# = 0
, generate a unique sequence number by incrementingbicont.bcseqn
until 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
INQ
mode, onlyVIEW
operation is allowed; no database updates occur.
Calculations¶
- Sequence Number Generation:
- Retrieve
bcseqn
frombicont
for the givencono
. - Increment
bcseqn
and checkarcufm
for uniqueness usingcono
andseq#
. - 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
CREATE
andUPDATE
operations. - QCMDEXC: Applies file overrides based on
fgrp
.