Explorer_Add_Column_To_Object

Examples


The Explorer_Add_Column_To_Object procedure defined in the SmartList dictionary adds a new column to a SmartList object.

Syntax

Explorer_Add_Column_To_Object, Object_Dict_ID, Object_Type, Field_Dict_ID, Field_ID, Display_Name, Field_Name, Default_Display, Datatype, DDL_Type, In_Lookup, User_Defined_Field, Display_Sequence, Field_Sequence, Error

Parameters

Object_Dict_ID – An integer specifying the dictionary that defines the SmartList object to which a column is being added. For SmartList objects defined in the core application, use the constant DYNAMICS.

Object_Type – An integer indicating the SmartList object in the specified dictionary to which the column is being added. For SmartList objects defined in the core application, use one of the constants described in SmartList objects.

Field_Dict_ID – An integer specifying the dictionary in which the field to use for the column is located.

Field_ID – An integer specifying the unique ID to use for the column. Typically, this will be the resource ID of the field used for the column.

Display_Name – A string that will be the default name for the column. The string can be up to 80 characters long.

Field_Name – A string containing the technical name of the field used for the new column.

Default_Display – A boolean that indicates whether the column will be displayed as part of the default query. The value true indicates it will, while false indicates it will not.

Datatype – An integer specifying the underlying datatype of the column being added. The value corresponds to one of the following constants:

[spacer]

Datatype

Constant

Value

Integer

SMARTLIST_DATATYPE_INTEGER

1

Long integer

SMARTLIST_DATATYPE_LONG

2

Date

SMARTLIST_DATATYPE_DATE

3

Currency

SMARTLIST_DATATYPE_CURRENCY

4

String

SMARTLIST_DATATYPE_STRING

5

Boolean

SMARTLIST_DATATYPE_BOOLEAN

6

Drop-down list

SMARTLIST_DATATYPE_DDL

7

Account index

SMARTLIST_DATATYPE_ACCOUNTINDEX

8

Account number

SMARTLIST_DATATYPE_ACCOUNTNUMBER

9

Phone number

SMARTLIST_DATATYPE_PHONENUMBER

10

Social Security number

SMARTLIST_DATATYPE_SSN

11

Time

SMARTLIST_DATATYPE_TIME

12


DDL_Type – An integer that specifies whether the list field used for the column is 0-based (items numbered 0, 1, 2) or 1-based (items numbered 1, 2, 3). Specify 0 for 0-based numbering. Specify 1 for 1-based numbering. If the field is not a list, specify 1.

Radio groups use 0-based numbering. All other list fields, such as drop-down lists and list boxes, use 1-based numbering.


In_Lookup – A boolean that indicates whether the column should appear in the Advanced Lookup window for the SmartList object to which you are adding a column. This parameter should be set to true only if your added columns to an existing SmartList object in the core dictionary that has a corresponding Advanced Lookup window.

User_Defined_Field – A boolean that indicates whether the field used for the column is a user-defined field. The value true indicates that it is, while false indicates that it is not. User-defined fields have their prompts defined at runtime by the user.

Display_Sequence – A returned integer that indicates the sequence the new colum will be displayed in if you have chosen to include it in the default query. You should initially set this value to zero. SmartList will return the next available sequence number that you can use when adding additional columns to the specified SmartList object.

Field_Sequence – A returned integer that indicates the sequence number of the column being added to the SmartList object. You should initially set this value to zero. SmartList will return the next available sequence number that you can use when adding additional columns to the specified SmartList object.

Error – A returned integer containing the database error that was returned by SmartList when the column was added. The following table lists the typical values returned:

[spacer]

Constant

Value

Error type

OKAY

0

No Error

DUPLICATE

17

Duplicate Record


Comments

When a new column is added to a SmartList object, the information about the column is written to the ASITAB20 table. If incorrect parameter values were used when you wrote the column, you will have to manually remove the record from this table. If you leave the existing record and try to rewrite the column information with parameter changes, you will receive a dupliate record error.


Documentation Feedback