You are here: Function Reference > Alphabetical Listing > D > DelField

DelField

Use this procedure/function to delete a field from a section. The system only deletes the field if found and if it is not the current field.

Syntax

DelField (Field, Section, Form, Group)

Parameter

Description

Field

Enter the name of a field. The default is the current field.

Section

Enter the name of a section that contains the field named. The default is the current section.

Form

Enter the name of a form that contains the section and/or field named. The default is the current form.

Group

Enter the name of the form group that contains the form, section, and/or field named. The default is the current group.

The system returns one (1) if it finds and deletes the field or zero (0) if it does not.

Note The DelField function can not be used in a script called by these AFGJOB rules: PreTransDAL and PostTransDAL.

Example

Lets assume you have the following forms in your form set; Information and Multi-section in the group named DAL Test Company.

The form named Information is comprised of two sections; Part1 and Part2. Part1 has these fields: abc1, abc2, and abc3. Part2 has these fields: abc3 and abc4.

The form named Multi-section is comprised of three sections: Section1, Section2, and Section3. Section1 has objects with these field names: a/n, date, yes/no, and multiline.

Section2 has the same objects with the same field names as Section1.

Section3 has following objects: graphic, box, and input value.

The DAL script which is executed is on a field named Test on Part1 of Information.

Here are some examples:

Procedure

Result

Explanation

Return(DelField ( "abc3" ));

1

Abc3 on Information/Part1 is deleted because the section, field, and group parameters were omitted specified. The system defaulted to the current section, form, and group.

Return(DelField ( "abc3", "part2" ));

1

Abc3 on Information/Part2 is deleted because you specified Part2 and the form defaulted to the current form, Information. Note that Abc3 will still exist on Information/Part1.

Return(DelField ( "test" ));

0

Test is not deleted because it is the current field.

Return(DelField ( "a/n" ));

0

The field a/n is not deleted because it is not on Information/Part1.

Return(DelField ( "a/n", "Section1" ));

0

The field a/n is not deleted because Section1 is not a field on the current form (Information).

Return(DelField ( "a/n", "Section1", "Multi-section" ));

1

The field a/n on Multi-section/Section1 is deleted because this field is on the specified form/section.

Return(DelField ( "a/n", , "Multi-section" ));

1

The field a/n on Multi-section/Section1 is deleted because field is on the specified form and the section parameter defaults to the first section on the form.

Field a/n on Multi-section/Section1 will still exist.

If you immediately execute the script again, the field a/n on Image2 would be deleted.

Return( DelField ( "a/n", , , "DAL Test Company" ));

1

The field a/n on Multi-section/Section1 is deleted because it was is the first field in the group, DAL Test Company.

Field a/n on Multi-section/Section2 will still exist.

If you immediately execute the script again, the field a/n on Image2 would be deleted.

Return(DelField ( "box", "Section3", "Multi-section" ));

0

The field Box is not deleted because you can only delete variable fields. You can not delete objects such as boxes, charts, lines, text labels, text areas, notes, and so on. You can, however, use the DelLogo function to delete graphics.

See also