Passing argument from Form to Class in Ax 2012

FORM

form2class

void clicked()

{
Form2ClassJk f2c;

super();

f2c=new Form2ClassJk();
f2c.GetInt(intCont.value());
f2c.GetStr(StringCont.valueStr());

}

CLASS

class Form2ClassJk
{

}

public void GetInt(int a)
{
info(strFmt(“%1”,a));
}

public void GetStr(str s)
{
info(strFmt(“%1″,s));
}

Static void main(Args args)
{
str fullname;
container con;

fullname=args().parm();

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

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