Retrieving Control Values from an existing Form instantiated in X++ via FormRun

I have a custom form that is calling the smmEmailDistribution form. My custom form, needs to be able to retrieve information that the user had changed in various controls on the smmEmailDistribution form. I am doing the following in my custom form’s button’s clicked() method…

void clicked()

{

FormStringControl strEdit;

Args args;

FormRun formRun;

;

args = new args();

args.name(formstr(smmEmailDistribution));

formRun = classFactory.formRunClass( Args );

formRun.init();

formrun.run();

formrun.wait();

// Add code here to retrieve the value of the smmEmailDistribution.Email1 (StringEdit) Field

// I am assuming I need to use the formrun.control() method somehow???

super();

}

Looks like I figured this one out on my own…

I would add the following line to my code to retreive the value of the Email1 StringEdit control:

strEdit = formrun.design().controlName(“Email1”);