Change field attributes in a temp-table buffer
- Last Updated: October 15, 2024
- 3 minute read
- OpenEdge
- Version 13.0
- Documentation
You can change certain field attributes in a dynamic temp-table after you have prepared it,
including the label, format, help, and column-label. You do this by using the
DEFAULT-BUFFER-HANDLE and setting one or more field attributes on a
buffer-field. This is only possible with dynamic temp-tables.
CustNum field:
|
MESSAGE shown confirms that the field format and label have changed.
If you look at the CustNum label and format through the second dynamic
buffer, the CustSeq2 buffer, you see that the format and label of the
second buffer have the same value as in the default buffer even though the field in the
default buffer was only changed after the second buffer was created.
To illustrate an important point about multiple temp-table buffers:
- Change the message statement to display the attributes through the second
buffer:
The label and format are changed, even as seen through the second buffer:ASSIGN hCustNum = hTT:DEFAULT-BUFFER-HANDLE:BUFFER-FIELD("CustNum") hCustNum:LABEL = "Test" hCustNum:FORMAT = "999999". MESSAGE "Label: " hTTB:BUFFER-FIELD("CustNum"):LABEL SKIP "Format: " hTTB:BUFFER-FIELD("CustNum"):FORMAT VIEW-AS ALERT-BOX.
- Add a line of code that sets the label of the CustNum field in the second
buffer:
None of the changes made to the default buffer are seen in that buffer:hTTB:BUFFER-FIELD("CustNum"):LABEL = "Okay". ASSIGN hCustNum = hTT:DEFAULT-BUFFER-HANDLE:BUFFER-FIELD("CustNum") hCustNum:LABEL = "Test" hCustNum:FORMAT = "999999". MESSAGE "Label: " hTTB:BUFFER-FIELD("CustNum"):LABEL SKIP "Format: " hTTB:BUFFER-FIELD("CustNum"):FORMAT VIEW-AS ALERT-BOX.
So the rule is that any changes you make to fields through the default buffer are also seen in any additional dynamic buffers for the temp-table, if no other changes have been made through the other buffer. Otherwise, the alternate buffer’s field attributes are initialized to the state of the fields at the time the alternate buffer is created. In that case, any changes made to fields through the alternate buffer are not seen in the default buffer, and any other changes made to the default buffer after that remain separate from the alternate buffer.