Hi Girac,

When you are using Action Type menu item and you have set the datasource,
the selected record will be automatically passed to the called class.

In the main method of the called class you will have args as parameter.

Now if you use args.record() you should get your record.

You can assign this to some local PurchTable record and use it for your
purpose.

Your code may look like this

public static void main(Args _args)
{
    PurchTable        localPurchTable;
    ;

    if (!_args || !_args.caller())
        throw error("Wrong call of the class");

    if (_args.dataset() == tableNum(PurchTable))
    {
        localPurchTable = _args.record();
        //Call ur code here
    }
}

Hope this helps.

Regards,
Sumit Loya

On Fri, Sep 11, 2009 at 10:10 AM, Anitha S <mail2eani...@gmail.com> wrote:

>
>
> Giriac,
>
> Try this.
>
> In the "*Active*" method of the datasource, u can get the value of the
> current record.
> If your requirement is fetching the value for the selected record, this
> will work.
>
> Try with *infolog/print *in the above method to check the value of the
> result.
>
> Hope this helps!!!
>
> Regards,
> Anitha
>
>
>
>
>  On Fri, Sep 11, 2009 at 1:00 AM, girac127 <girac...@yahoo.com> wrote:
>
>>
>>
>> Anitha,
>>
>> Thank you for your reply, On my form I have a grid with the PurchID as one
>> value. On this form I added a MenuAction to point my my class.
>>
>> In my class I have the query "while select PurchTable where
>> PurchTable.PurchId == 'PurchIDValueFromForm'"
>> this create my text file as I expect. but I need to change the
>> "PurchIDValueFromForm" for each selected record that I create file from.
>>
>> What is the way to accomplish this
>>
>> I have tried your suggestion however it is not pulling the right data
>> related to the selected record.
>>
>> Regards
>> G
>>
>>
>> --- In 
>> Axapta-Knowledge-Village@yahoogroups.com<Axapta-Knowledge-Village%40yahoogroups.com>,
>> Anitha S <mail2eani...@...> wrote:
>> >
>> > I could not get the clear picture of ur query. I understood the first
>> part
>> > of it.
>> > Try this.
>> > From your question , i understud PURCHID is in the datasource.
>> > So you can directly use it as *datasourcename.PurchID or
>> > FormControName.text()* and pass it as parameter to the class method.
>> > Else you can pass the Table as parameter.
>> >
>> > Hope it helps!!!
>> >
>> > Regards,
>> > Anitha
>> >
>> > On Thu, Sep 10, 2009 at 6:34 AM, girac127 <girac...@...> wrote:
>> >
>> > >
>> > >
>> > > Hello all,
>> > >
>> > > I have created a job to query and create file. I will drag that into a
>> > > class.
>> > > Now I need to to pass a parameter from my form (the PurchTable.PurchID
>> > > field of the record that is selected) to the class and use that as my
>> > > parameter in my query.
>> > > How can I accomplish this?
>> > >
>> > > Best regards
>> > > G
>> > >
>> > >
>> > >
>> >
>>
>>
>  
>

Reply via email to