how to pass varible values from class to form.

Hi

I am calling one form through my dialog class.In which I am passing few varible values to the form via parm methods .I am calling tht parm methods in init method in the form but iam not able to get the values.

Please share :slight_smile:

thanks in advance :slight_smile: EEnnjjOOyyy

tc

Is it NAV?

Can you show the code how you are calling and OnInit trigger? Did you try to move the code in OnInit to OnOpen form?

I am calling formโ€™s init() method from run method in dialod class.Here i hav to pass the values of few variable to form.

formrun.init() ;

formrun.run();

formrun.wait();

wht is NAV?

Hi,

I think the args class can help you to get parms passed to you form, you shoul call it in your formโ€™s init() method

Hope it helps

Regards

Thomas

hi Thomas

Dude thnks for ur words.

Here i hav created an object of my class in forms inti method to call parm methods to get the values of class avaribales.

like classname object;

But As i intialize it with the class name new object is created and i lost the variable values. Bcoz new object holds the new copy of variables.

like object = new classname( );

transdate frmDate = object.parmfromDate( ); // here method parmfromDate use to return frmDate .

I tried with the Args caller method but i dont knw hw exactly it is sappose to use. :stuck_out_tongue:

dude can u explain further how exactly i should Args class in my forms init methods.

thanks :slight_smile:

Ganesh sahane

Hi ganesh,

For example, in your class, in a run or main method:

Args args;
FormRun formRun;
;
args = new args();
args.parm(yourParm);
args.name(formstr(yourFormName));
formRun = classFactory.formRunClass(Args);
formRun.init();
formrun.run();
formrun.wait();

in your form, add an init() method:

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

see the following link to Axaptapedia, it also works with classes: http://www.axaptapedia.com/index.php?title=Passing_values_between_forms

Regards,

Thomas

Hi ganesh,

u can use arg function for passing the values from one form to another form ;

ex

args args;

args.parm(journalId);

new Menufunction(menuitemoutputstr(u r menu name),menuitemtype::Output).run(args);

if u have more than one values to pass

then u can use the temperory table and store the values in it and pass that table

regards

Dhinu vasudevan.

Hi Dhinu

I hav to pass the argument from class to form. :slight_smile:

Regards

Ganesh

Hi

Dear Thomas Its working.Thnaks a loottTT :slight_smile: :slight_smile:

Regards

Ganesh B Sahane