Showing posts with label class. Show all posts
Showing posts with label class. Show all posts

Wednesday, 12 October 2011

How to pass parameters from Form to Class

Hi, 
To pass the parameters from form to class is straightforward.
1.Create a class yourClass
class yourClass { }
2. override the new method

void new(PurchID purchid)
{
;
info(Itemid);
}
---------- Class Completed
Go to form purchTable
1. Add a button
2. override the click method of the button with following code
void clicked() 
{  
PurchID purchId;
Args args=new Args();
YourClass yourClass;  
;
purchId=args.parm(purchTable.purchid);  
yourClass=new YourClass(purchid); 
}
Save and Compile
now when u will hit the button on purchTable form it will return the current purchid of the data source . I hope it will help
Cheers,