9 57 DOM_ADD_ITEM

LANSA Technical

9.57 DOM_ADD_ITEM

Þ Note: Built-In Function Rules.

Adds an item to an open data note using the item name. The item type must also be specified.

The item types supported are the simple data types TYPE_TEXT,  TYPE_NUMBER, TYPE_TIME and TYPE_TEXT_LIST as these are the closest types to the standard LANSA data types A (Alphanumeric), P (Packed) and S (Signed). The data will be converted to the required item type and from EBCDIC to LMBCS for TYPE_TEXT,  TYPE_DATE and TYPE_TEXT_LIST items.

Either an alphanumeric field value or numeric field value should be specified to create the new item.  For a TYPE_TIME item, the alphanumeric value may be specified as '*CURRENT', in which case the current date and time will be set for the item otherwise the date/time value must be supplied in the correct format e.g. mm/dd/yy hh:mm:ss. For a TYPE_TEXT_LIST item, the value will be added to the existing item if the text list item already exists.

Note that the document/data note is not updated in the database until you use the DOM_UPDATE_DOCUMENT Built-In Function.

For use with

LANSA for i

YES

Visual LANSA for Windows

YES

Visual LANSA for Linux

NO

 

 

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Document/Data Note handle

4

4

 

 

2

A

Req

Item name to be added to the document

1

65

 

 

3

N

Req

Item type in note:

1 = TYPE_NUMBER

2 = TYPE_TEXT

3 = TYPE_TIME

4 = TYPE_TEXT_LIST

1

7

0

0

4

A

Opt

Alphanumeric field required for item type TYPE_TEXT, TYPE_TIME & TYPE_TEXT_LIST
Refer to Argument Item 4.

1

Unlimited

 

 

5

N

Opt

Numeric field required for item type TYPE_NUMBER

1

15

0

9

 

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Return code

OK = Item successfully added.

ER = Item not added.

2

2

 

 

 

 

Example

Refer to this Domino Built-In Function Example:

Example 1: Creating a New Document in a Database

Technical Notes

This Built-In Function uses the standard Lotus Notes APIs NSFItemSetNumber, NSFItemSetText, ConvertTextToTIMEDATE, NSFItemSetTime and NSFItemAppendTextList. All security and integrity issues related to the use of this Built-In Function are according to normal Lotus Notes API use for the current platform.

Argument Item 4

This Built-In Function also converts the value of the fourth argument (whenever it is applicable ) into LMBCS equivalent  using Lotus API OSTranslate, which can process up to 65535 bytes only. Therefore, the length of the added Item must not exceed 65535 bytes.