Passing argument from Class to Form in Ax 2012

CLASS

class2form

 

FORM

public void init()
{
str fullname;
container con;

super();

fullname=element.args().parm();

con = str2con(fullname,”-“);
NumCont.value(conPeek(con,1));
NameCont.text(conPeek(con,2));
}

CLASS

class Class2Form
{
int a,b;
str s;
}

Public int GetIntvalue()
{
a=10;
return a;
}

Public str GetStrValue()
{
s=”Johnkrish”;
return s;
}

Static void main(Args args)
{
str fullname;
//Args args;
container con;
FormRun formRun;
Class2Form co;

co=new Class2Form();
args=new Args();
con=conIns(con,1,co.GetIntvalue());
con=conIns(con,2,co.GetStrValue());

fullname=con2Str(con,”-“);
args.parm(fullname);
args.name(“Class2Form”);
formRun = classFactory.formRunClass( Args );
formRun.init();
formrun.run();
formrun.wait();
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s