passing datasource record from form to menuitem class in ax 2012

Hi All,

I want to pass the current record from from to its menuitem button action class. How this can be achieved. Please suggest an answer in ax 2012

Thanks in advance,

Gopinath

Parents
No Data
Reply
  • Hi Gopi,

    may be bellow code help full for you.

    public static void main(Args  _args)
    {
        FormRun             caller;
        FormStringControl   fcsAllocationId;
        FormDateControl     fdsFrmDate, fdsToDate;
        FormDataSource      formDataSource;
        AllocationId  allocationId;
        date                fromDate, toDate;

        AllocationUpload upload = new AllocationUpload();

        caller = _args.caller();

        fdsFrmDate  = caller.control(caller.controlId("Allocation_FromDate"));
        fromDate    = fdsFrmDate.dateValue();

        fdsToDate   = caller.control(caller.controlId("Allocation_ToDate"));
        toDate      = fdsToDate.dateValue();

        fcsAllocationId = caller.control(caller.controlId("Allocation_AllocationId"));
        allocationId = fcsAllocationId.text();

        upload.loadingTimesheetData(fromDate, toDate, allocationId);

        formDataSource = _args.record().dataSource();
        formDataSource.research(true);
    }

Children
No Data
Related
Recommended