How to pass the parameter from one form to another in Dynamic AX

1.       Create two forms with Name FormA & FormB

2.       FormA with 1 stringedit and 1 button & FormB with 1 StringEdit.
3.       Below code is override in clicked method() of button.
    // Args class is usually used in Axapta for passing parameters between forms
    Args            args;
    FormRun         formRun;
    args = newargs();  
    // Our values which we want to pass to FormB
    // If we want pass just simple string we can use ‘parm’ method of ‘Args’ class
    args.parm( AccountNum.text() );
    // Run FormB formstr( FormB ) );
    formRun = classFactory.formRunClass( Args );
4.       Now override init() method in FormB.
public voidinit()
    str             anyStringValueFromCaller;
    // Check for passed arguments
    if( element.args() )
        // get string parameter
        anyStringValueFromCaller = element.args().parm();
Share on email
Share on facebook
Share on twitter
Share on linkedin
Share on pinterest

Leave a Reply

Your email address will not be published.