Returns the current caption of an object as a string and sets a
new caption for the object.
|
[CurrCaption :=] Form.CAPTION([NewCaption])
|
Parameters
- NewCaption
-
Type: Text or code
The new caption for the object.
Property Value/Return Value
Type: Text or code
The current caption, as a string.
Remarks
Example
This example shows how to use the CAPTION function.
This example assumes that the current form is form 42, Sales Order,
and the CaptionML property of this form is ENU=Sales Order. This
example requires that you create the following variables and text
constants in the C/AL Globals window.
Variable name |
DataType |
Length |
OriginalCaption
|
Text
|
1024
|
NewCaption
|
Text
|
1024
|
CaptionString
|
Text
|
1024
|
Text Constant |
ENU Value |
Text000
|
The original caption was %1.
|
Text001
|
The new caption is %1.
|
|
Copy Code |
OriginalCaption := CurrForm.CAPTION;
MESSAGE(Text000, OriginalCaption);
CaptionString := ' Some New Caption';
CurrForm.CAPTION(CaptionString);
NewCaption := CurrForm.CAPTION;
MESSAGE(Text001, NewCaption);
|
The message windows could display the following:
The original caption was Sales Order.
The new caption is Some New Caption.
See Also