[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.axapta.programming

Pass value from form to class

Jens Strandberg

12/14/2005 1:51:00 PM

Hello there,

I have created a class with it's own dialog.

How do I pass a given value in a grid (let's say the SalesId in the form
SalesLineOpenOrders) to my class; i.e. the SalesId ?

Thanks.

/Jens
3 Answers

Anish Abslom

12/14/2005 2:27:00 PM

0

Hi Jens,

If I am not wrong is the scenario something as followsâ?¦.
You need to pass a value from your form to your classâ?¦
If that is the case then it is straight forward approach��..

Step1
Declare a variable of salesid in the class declaration of your class
Follow this piece of code

class Class1
{
salesId salesid;
}

Step2

Create a method by name â??newâ? in your class with a parameter value
Follow this piece of code

void new(salesId _salesId)
{
;
salesId = _salesid;
}


Step3

Initialize this class in your event from where ever you want to supply your
sales Id
Is it from your forms , tables or even another class it self as follow���.

static void Test_Parameter_transfer(Args _args)
{
class1 class1; //class declaration
;
class1 = new class1("ax0017"); //class initialization with salesID
print class1.parm_method(); //printing the value from the class
pause;

-------------------------------------------------------------------------------------------------------
If you are trying the full code donâ??t forget to put this piece of code in
your class (class1)

salesId parm_method()
{
;
return salesId;
}

Hope this will solve your issueâ?¦.

With regards
Anish


Anish Abslom

12/14/2005 2:31:00 PM

0

Hi Jens,

If I am not wrong is the scenario something as followsâ?¦.
You need to pass a value from your form to your classâ?¦
If that is the case then it is straight forward approach��..

Step1
Declare a variable of salesid in the class declaration of your class
Follow this piece of code

class Class1
{
salesId salesid;
}

Step2

Create a method by name â??newâ? in your class with a parameter value
Follow this piece of code

void new(salesId _salesId)
{
;
salesId = _salesid;
}


Step3

Initialize this class in your event from where ever you want to supply your
sales Id
Is it from your forms , tables or even another class it self as follow���.

static void Test_Parameter_transfer(Args _args)
{
class1 class1; //class declaration
;
class1 = new class1("ax0017"); //class initialization with salesID
print class1.parm_method(); //printing the value from the class
pause;
}
-------------------------------------------------------------------------------------------------------
If you are trying the full code donâ??t forget to put this piece of code in
your class (class1)

salesId parm_method()
{
;
return salesId;
}

Hope this will solve your issueâ?¦.

With regards
Anish


koffidan

12/15/2005 3:19:00 PM

0

Hi

Go to this homepage:
http://www.axaptapedia.com/index.php/Multiple_grid_...

I hope that it helps!
--
Koffidan

http://ww...



"Jens Strandberg" wrote:

> Hello there,
>
> I have created a class with it's own dialog.
>
> How do I pass a given value in a grid (let's say the SalesId in the form
> SalesLineOpenOrders) to my class; i.e. the SalesId ?
>
> Thanks.
>
> /Jens