[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.axapta.programming

How to pass a record back from a form?

Oct@ESI

11/2/2005 6:16:00 PM

I have a pop up form to do contact validation. I pass the record via the args
in a class, originally called from ValidateWrite method in the table.

The form will allow user to manipulate the data, after the validation
component corrected the data, and somehow, I need to pass this modified
record back to the class that called it.

Any suggestion?
2 Answers

Kyle Alons

11/2/2005 6:26:00 PM

0

1. Write an accessor method on the class that calls the form, that will
update the object state using the modified record from the form.

2. From the form, get hold of the calling object using args.caller() - then
use the accessor method you defined to change the object state. Make sure
that the args object has the caller set before opening the form -
args.caller(this).

JFB

"Oct@ESI" <OctESI@discussions.microsoft.com> wrote in message
news:50CEF55F-64E9-4929-A09B-9D34EA841F4B@microsoft.com...
>I have a pop up form to do contact validation. I pass the record via the
>args
> in a class, originally called from ValidateWrite method in the table.
>
> The form will allow user to manipulate the data, after the validation
> component corrected the data, and somehow, I need to pass this modified
> record back to the class that called it.
>
> Any suggestion?


vladimir40

11/3/2005 1:19:00 AM

0

Here is the example:
a table:
public boolean validateWrite()
{
classUpdateContact updateContact;
args args;
....
if(??)
{
//here goes your class
args = new Args();
args.record(this);
updateContact = new classUpdateContact(arg);
updateContact.run();
this.data(args.record());
//in your class run()
args.name(formstr(PopUpUpdateContact)); //this the same
args object
args.caller();
formRun = classFactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.wait();
args.record(formRun.datasource().cursor());
//reuse the args() in ValidateWrite()



"Oct@ESI" wrote:

> I have a pop up form to do contact validation. I pass the record via the args
> in a class, originally called from ValidateWrite method in the table.
>
> The form will allow user to manipulate the data, after the validation
> component corrected the data, and somehow, I need to pass this modified
> record back to the class that called it.
>
> Any suggestion?