SetEditTable method: Record class
Syntax
SetEditTable(%PromptField, RECORD.recordname)
Description
The SetEditTable method works with the ExecuteEdits method. It sets the value of a field on a record that has its prompt table defined as %PromptField value. %PromptField values are used to dynamically change the prompt record for a field.
There are several steps to setting up a field so that you can dynamically change its prompt table.
To set up a field with a dynamic prompt table:
-
Define a field in the DERIVED record called fieldname.
-
In the record definition for the field you want to have a dynamic prompt table, define the prompt table for the field as %PromptField, where PromptField is the name of the field you created in the DERIVED record.
Note:
When you use SetEditTable, you don’t have to add a hidden field to the page.
-
Use SetEditTable to dynamically set the prompt table.
%PromptField is the name of the field on the DERIVED work record. RECORD.recordname is the name of the record to be used as the prompt table.
&REC.SetEditTable("%EDITTABLE1", Record.DEPARTMENT);
&REC.SetEditTable("%EDITTABLE2", Record.JOB_ID);
&REC.SetEditTable("%EDITTABLE3", Record.EMPL_DATA);
&REC.ExecuteEdits();
Every field on a record that has the prompt table field %EDITTABLE1 will have the same prompt table, that is, DEPARTMENT.
See ExecuteEdits method: Record class, Application Designer Developer’s Guide: Understanding Record Definitions.
Parameters
| Parameter | Description |
|---|---|
|
%PromptField |
Specifies the name of the field in the DERIVED record that has been defined as the prompt table for a field in the record definition. |
|
RECORD.recordname |
Specifies the name of the record definition that contains the correct standard system edits to be performed for that field in the record. |
Returns
None.
Example
/* To Set the Prompt Table */
&Der_EditRec = &TSKPRF_Det_Row.GetRecord(Record.DERIVED);
&Prompt_Editname = &Der_EditRec.EDITTABLE.Value;
&Prompt_Edittable = "Record." | &Prompt_Editname;
&TSKPRF_Det_Rec.SetEditTable("%EDITTABLE", @&Prompt_Edittable);
&Prompt_Editname2 = &Der_EditRec.EDITTABLE2.Value;
&Prompt_Edittable2 = "Record." | &Prompt_Editname2;
&TSKPRF_Det_Rec.SetEditTable("%EDITTABLE2", @&Prompt_Edittable2);
&Prompt_Editname3 = &Der_EditRec.EDITTABLE3.Value;
&Prompt_Edittable3 = "Record." | &Prompt_Editname3;
&TSKPRF_Det_Rec.SetEditTable("%EDITTABLE3", @&Prompt_Edittable3);
&Prompt_Editname4 = &Der_EditRec.EDITTABLE4.Value;
&Prompt_Edittable4 = "Record." | &Prompt_Editname4;
&TSKPRF_Det_Rec.SetEditTable("%EDITTABLE4", @&Prompt_Edittable4);
&Prompt_Editname5 = &Der_EditRec.EDITTABLE5.Value;
&Prompt_Edittable5 = "Record." | &Prompt_Editname5;
&TSKPRF_Det_Rec.SetEditTable("%EDITTABLE5", @&Prompt_Edittable5);
&Prompt_Editname6 = &Der_EditRec.EDITTABLE6.Value;
&Prompt_Edittable6 = "Record." | &Prompt_Editname6;
&TSKPRF_Det_Rec.SetEditTable("%EDITTABLE6", @&Prompt_Edittable6);
&TSKPRF_Det_Rec.ExecuteEdits(%Edit_Required + %Edit_PromptTable);
Considerations for SetEditTable and ExecuteEdits
The keys used to "select" the correct row in the prompt table record come only from the record object executing the method. All the keys from the component are not used. You may get unexpected results if not all the keys for the prompt table are filled in (or filled in correctly.)