Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Sunday, September 13, 2015

Look up date and calendar in AX

Hi,

void lookup()
{
    ProjPeriodId    projPeriodId = DNGRMParameter::find().PeriodId;
    ProjPeriodTo    projPeriodTo;
    ProjControlPeriod  projControlPeriod = new ProjControlPeriod();
   // projControlPeriod = element.args().caller().runbase();
    //if (!projControlPeriod.parmPeriodic())
    //{
        //if (this.dateValue())
        //{
            //projPeriodTo = this.dateValue();
        //}
        //else
        //{
            //projPeriodTo = ProjPeriodLine::findPrevFromDate(projPeriodId, systemdateget()).PeriodTo;
        //}
    //}
    //else
    //{
        if (this.dateValue())
        {
            projPeriodTo = this.dateValue();
        }
        else
        {
            projPeriodTo = ProjPeriodLine::findPrevFromDate(projPeriodId, systemdateget()).PeriodTo;
        }
   // }

    ProjPeriodLine::lookupPeriodTo(this, projPeriodId, projPeriodTo);
}

Regards,

Code to call Number sequence in AX 2012

Hi,

// You may use in initValue of the table or datasource or for insert the records using the codes.
NumberSeq numberSeq;
numberSeq = NumberSeq::newGetNum(DpayHRM::EdtName());
print  num.num(); // instead of print you may assign to the table.

Regards,

Code to run the report in clicked method of the button in AX

Hi,

void clicked()
{
    Args            args;
    ReportRun       reportRun;
    NSGEosTransactions  esotransactions;
    ;
     select esotransactions where esotransactions.EosTransId == NSGEosTransactions.EosTransId;
    args    = new args();
    args.name(reportstr(NSG_EOSReport)); // Report name
    args.record(esotransactions); 
    args.parm(NSGEosTransactions.EosTransId); // Parameter value that I passes.
    reportRun = classFactory.reportRunClass(args);
    reportRun.init();
    reportRun.run();
}


Regards,

Any currency to accounting currency in AX 2012

Hi,

Currency::amount(markupTransAllocate.Value, markupTransAllocate.CurrencyCode);

Regards,

Dimension Lookup for both standard and Custom dimension in D365

Hi,  /// <summary>     /// Provides the look-up interaction for the individual dimension value lookup controls.     /// </summary&g...