[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

setting a class as a caller object

Fanatic

1/12/2006 10:26:00 AM

Hey, I'm calling a form from a class. How can I set the args.calller() object
to the class. The class doesn't have a "this" object, or I can't get to it...
In the form, I want to use the code

if (classIdGet(element.args().caller()) == classNum(InventTransWMS_Register))

But I can't get this class as a calling object
3 Answers

trucosaxapta.com

1/12/2006 11:29:00 AM

0

Hi,

If you are not able to use "this" in your method this may be because you're
using an static method and then no object instance available.

In this case, maybe you can use any other args parameter instead of caller
(like parm()) to manually specify where u're calling the form from.

Good luck,

Mkz.
------------------
http://www.trucos...
An Axapta tricks site in spanish language :)

"Fanatic" <Fanatic@discussions.microsoft.com> escribió en el mensaje
news:6BC34D57-8E98-4A86-884E-1431907EB6D1@microsoft.com...
> Hey, I'm calling a form from a class. How can I set the args.calller()
object
> to the class. The class doesn't have a "this" object, or I can't get to
it...
> In the form, I want to use the code
>
> if (classIdGet(element.args().caller()) ==
classNum(InventTransWMS_Register))
>
> But I can't get this class as a calling object


Palle Agermark [MSFT]

1/18/2006 1:32:00 PM

0

You must assign your class to the args object being passed to the form, when
you open the form.

It should look something like this on your calling class:

....
Args args = new Args();
FormRun FormRun;
;
args.caller(this);
formRun = classFactory.formRunClass(args);
formRun.init();
....

--
Best Regards,
Palle Agermark

This posting is provided "AS IS" with no warranties, and confers no rights.


"Fanatic" wrote:

> Hey, I'm calling a form from a class. How can I set the args.calller() object
> to the class. The class doesn't have a "this" object, or I can't get to it...
> In the form, I want to use the code
>
> if (classIdGet(element.args().caller()) == classNum(InventTransWMS_Register))
>
> But I can't get this class as a calling object

Andrew Jones

1/19/2006 8:04:00 AM

0

Hi agree with Mkz.

If you have no access to 'this' then you are probably inside a static
method. In this case, by definition, there is no 'current object'. Perhaps
you can rework the code to use a normal instance method. Otherwise there is
no way to specify the current object as the caller because there isn't one!

Hope that clarifies rather than confuses

Andrew Jones



"trucosaxapta.com" wrote:

> Hi,
>
> If you are not able to use "this" in your method this may be because you're
> using an static method and then no object instance available.
>
> In this case, maybe you can use any other args parameter instead of caller
> (like parm()) to manually specify where u're calling the form from.
>
> Good luck,
>
> Mkz.
> ------------------
> http://www.trucos...
> An Axapta tricks site in spanish language :)
>
> "Fanatic" <Fanatic@discussions.microsoft.com> escribió en el mensaje
> news:6BC34D57-8E98-4A86-884E-1431907EB6D1@microsoft.com...
> > Hey, I'm calling a form from a class. How can I set the args.calller()
> object
> > to the class. The class doesn't have a "this" object, or I can't get to
> it...
> > In the form, I want to use the code
> >
> > if (classIdGet(element.args().caller()) ==
> classNum(InventTransWMS_Register))
> >
> > But I can't get this class as a calling object
>
>
>