2 Understanding Naming Conventions

This chapter contains the following topics:

2.1 Source and Header File Names

Source and header file names can be a maximum of 8 characters and should be formatted as bxxyyyy, where:

  • b = BSFN object

  • xx (second two digits) = The system code, such as:

    • 01 = Address Book

    • 04 = Accounts Payable

  • yyyyy (the last five digits) = A sequential number for the system code, such as:

    • 00001 = The first source or header file for the system code

    • 00002 = The second source or header file for the system code

Both the C source and the accompanying header file should have the same name.

This table shows examples of this naming convention:

System System Code Source Number Source File Header File
Address Book 01 10 b0100010.c b0100010.h
Accounts Receivable 04 58 b0400058.c b0400058.h
General Ledger 09 2457 b0902457.c b0902457.h

2.2 Function Names

An internal function can be a maximum of 42 characters and should be formatted as Ixxxxxx_a, where:

  • I = An internal function

  • xxxxxx = The source file name

  • a = The function description

    Function descriptions can be up to 32 characters in length, and must not contain spaces. Be as descriptive as possible and capitalize the first letter of each word, such as ValidateTransactionCurrencyCode. When possible use the major table name or purpose of the function.

An example of a Function Name is I4100040_CompareDate

Note:

Do not use an underscore after I.

2.3 Variable Names

Variables are storage places in a program and can contain numbers and strings. Variables are stored in the computer's memory. Variables are used with keywords and functions, such as char and MATH_NUMERIC, and must be declared at the beginning of the program.

A variable name can be up to 32 characters in length. Be as descriptive as possible and capitalize the first letter of each word.

You must use Hungarian prefix notation for all variable names, as shown in this table:

Prefix Description
c JCHAR
sz NULL-terminated JCHAR string
z ZCHAR
zz NULL-terminated ZCHAR string
n short
l long
b Boolean
mn MATH_NUMERIC
jd JDEDATE
lp long pointer
i integer
by byte
ul unsigned long (identifier)
us unsigned Short
ds data structures
h handle
e enumerated types
id id long integer, JDE data type for returns
ut JDEUTIME
sz VARCHAR

2.3.1 Example: Hungarian Notation for Variable Names

These variable names use Hungarian notation:

Variable Description
JCHAR cPaymentRecieved;
JCHAR [ ] szCompanyNumber = _J(00000);
short nLoopCounter;
long int lTaxConstant;
BOOL bIsDateValid;
MATH_NUMERIC mnAddressNumber;
JDEDATE jdGLDate;
LPMATH_NUMERIC lpAddressNumber;
int iCounter;
byte byOffsetValue;
unsigned long ulFunctionStatus;
D0500575A dsInputParameters;
JDEDB_RESULT idJDEDBResult;

2.4 Business Function Data Structure Names

The data structure for business function event rules and business functions should be formatted as DxxyyyyA, where:

  • D = Data structure

  • xx (second two digits) = The system code, such as

    • 01 = Address Book

    • 02 = Accounts Payable

  • yyyy = A next number (the numbering assignments follow current procedures in the respective application groups)

  • A = An alphabetical character (such as A, B, C and so on) placed at the end of the data structure name to indicate that a function has multiple data structures

    Even if a function has only one data structure, you should include the A in the name.

An example of a Business Function Data Structure Name is D050575A.