LocateThePolicyKeyLineNumber

Locate the Policy Key Line number

Minor Business Rule

Object Name: B03B0051

Parent DLL: CFIN

Location: Client/Server

Language: C

B03B0051
Locate the Policy Key Line Number


Functional Description


Purpose
This business function retrieves the next number for a recored to be added in F03B25, F03B26, and 
F03B27.  Calling this function with an Option Code, 1, 2, or 3, will return the proper next line number 

or next policy number.  Call this business function before adding records to any of these files.


Setup Notes and Prerequisites

Option Code:
0 - To get the next policy number for adding a record to F03B25.

1 - To get the next line ID number for adding a record to F03B26.

2 - To get the next line ID number for adding a record to F03B27.


Special Logic

None.

Technical Specifications

Parameters

ItemDescriptionI/OReq? Notes
PLYPolicy NumberIYes
OPCDOption CodeIYes

LNIDLine ID NumberI/OYesIf Option Code is '0', Policy Number 

should be both input and output

PLNPolicy NameIYesRequired only when option code is a '0'

COCompanyIYesRequired only when option code is a '0'


Related Tables

F03B25A/R Delinquency Policy Table
F03B26A/R Delinquency Policy Notification

F03B27A/R Delinquency Policy Detail - Fees


Related Business Functions


Processing

• If Option Code is equal to '0',
• Fetch F03B25 with two keys: Company and Policy Name.
• If JDBReturn is not equal to JDEDB_PASSED (This means the record is being added),
• Fetch F03B25 descending using Policy Number as the key.
• Add Line ID Number by 1.
• Else (This record is being updated; no need to find the next number),
• Return.
• End if.
• Else,
• If Option Code is equal to '2',
• Fetch F03B27 using two keys: Policy Number and Line Number (sorted descending).
• If JDBReturn = JDEDB_PASSED,
• Add Line ID Number by 1.
• Else,
• Assign 1 to Line ID Number.
• End if.
• Else (This means Option Code is equal to '1'),
• Fetch F03B26 using two keys: Policy Number and Line Number (sorted descending).
• If JDBReturn = JDEDB_PASSED,
• Add Line ID Number by 1.
• Else,
• Assign 1 to Line ID Number.
• End if.
• End if.
• End if.

^

Data Structure

D03B0051 - Locate the Policy Key Line number

Parameter NameData ItemData TypeReq/OptI/O/Both
mnPolicynumberPLYMATH_NUMERICNONENONE

A number that the system assigns to each policy record to identify it.

cOptioncodeOPCDcharNONENONE

This code specifies whether the user will be prompted for additional information prior to running the application. Available values are:    0   
No processing options    1   Blind execution (no prompt)    2   Prompt for version    3   Prompt for values 

mnLinenumberLNIDMATH_NUMERICNONENONE

A number that identifies multiple occurrences, such as line numbers on a purchase order or other document. Generally, the system assigns 
this number,but in some cases you can override it.

szPolicyNamePLYNcharNONENONE

A name that specifies the set of rules that the system uses to determine when an invoice is considered past due and to specify the action 
that you want to take. The policy contains aging information for notices and fee instructions. You set up a policy to represent a group of 
customers based on either their payment habits or on a line of business. 

szCompanyCOcharNONENONE

A code that identifies a specific organization, fund, or other reporting entity. The company code must already exist in the Company 
Constants table (F0010) and must identify a reporting entity that has a complete balance sheet. At this level, you can have intercompany 
transactions. Note: You can use company 00000 for default values such as dates and automatic accounting instructions. You cannot use company 00000 
for transaction entries.

Related Functions

None

Related Tables

F03B26 A/R Delinquency Policy Notification
F03B27 A/R Delinquency Policy Detail - Fees