StrMenuHandler Attribute
Version: Available or changed with runtime version 1.0.
Specifies that the method is a StrMenuHandler method, which handles StrMenu statements.
Applies To
- Method
Note
The StrMenuHandler attribute can only be set inside codeunits with the SubType property set to Test.
Syntax
Version: Available or changed with runtime version 1.0.
[StrMenuHandler]
procedure StrMenuHandler(Options: Text[1024]; var Choice: Integer; Instruction: Text[1024])
Important
The above signature requires the StrMenuHandler method to be global. For more information, see Local and global scope in AL methods.
Version: Available or changed with runtime version 2.1.
[StrMenuHandler]
procedure StrMenuHandler(Options: Text; var Choice: Integer; Instruction: Text)
Important
The above signature requires the StrMenuHandler method to be global. For more information, see Local and global scope in AL methods.
Arguments
Choice
Type: Integer
The option chosen in the StrMenu.
Instruction
Type: Text[1024]
The leading text.
Instruction
Type: Text
The leading text.
Options
Type: Text[1024]
The list of the different option values.
Options
Type: Text
The list of the different option values.
Remarks
The StrMenuHandler method is called when a StrMenu method is invoked in code.
You use handler methods to automate tests by handling instances when user interaction is required by the code that is being tested by the test method. In these instances, the handler method is run instead of the requested user interface. The handler method should simulate the user interaction for the test case, such as validating messages, making selections, or entering values. You declare a handler type attribute on the method. For more information about handler methods, see Create Handler Methods.
See Also
AL Method Reference
Method Attributes
Test Codeunits and Test Functions
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈