call form through class in axapta

This code is to how to call any form using class.I think this is challenging for new developpers.
create mathod create form

 protected FormRun createForm(identifiername identifiername)  
 Args args;  
 FormRun formRun;  
 args = new Args();  
 formRun = new MenuFunction(identifiername, MenuItemType::Display).create(args);;  
 return formRun;  
 Public boolean prompt()  
 Object formRun;  
 formRun = this.createForm(menuitemdisplaystr(Formaname));  
 Code = formrun.formmathod();  
 return formRun.okPressed();