A developer needs to access the current Args buffer to determine the menu item name within an
object method in a dialog class. The Args buffer is currently accessible only in the main() method of
the class.
Scenario: The requirement is to display the “Worker Name” field on a dialog screen only when
opening the form through the “Project Details” menu item. However, the field should not be visible
when accessing the same form through another menu item, such as “Project Table”.

High level resolution steps

Detailed resolution steps

Steps 1: Navigate to the form’s clicked method, calling the dialog class’s main() method and pass
“element.args” as a parameter.

Parm Method

Code Explanation:

Steps 2: Create a new method (parmArgs) in the dialog class to facilitate setting and retrieving the args
parameter.

Code Explanation:

Steps 3: Call the parmArgs() method from main method and pass the args.

Code Explanation:

Steps 4: Within the object method of the dialog class, utilize the parmArgs method to retrieve args and
determine the current menu item name.
Implement a condition in the object method to check if the menu item name is “Project details”. If
true, make the “Worker Name” field visible on the dialog screen.

Code Explanation:

Output:
Scenario 1:
In this scenario, the requirement is to ensure that when the form is opened from the
“Project Information” menu item and a button is subsequently clicked, the “Worker’s Name” field should
not be visible.

Scenario 2: In this scenario, when the form is opened from the “Project Details” menu item and a button
is clicked, the “Worker’s Name” field should be visible.

Leave a Reply

Your email address will not be published. Required fields are marked *