Alfasith AX

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

Thursday, June 19, 2014

Calculate SalesTotal class and related information in X++

Hi,

static void SalesTotalAlfasith(Args _args)
{
    SalesTotals   salesTotals;
    SalesTable   salesTable;
    container   displayFields;
    str    totalTax, amountWithoutTax, amountInclTax;

    salesTable = salesTable::find('SO-101269');
    salesTotals  =  SalesTotals::construct(salesTable, salesUpdate::All);
    salesTotals.calc();
    displayFields =  salesTotals.displayFieldsCurrency(salesTotals.currencyCode());

    print   conpeek(displayFields, TradeTotals::posBalance());
    print   conpeek(displayFields, TradeTotals::posEndDisc());
    print   conpeek(displayFields,TradeTotals::posTaxTotal());
    pause;
}

Regards,

Calculate PurchTotal class and its related information in X++

Hi,

static void PurchTotalAlfasith(Args _args)
{
    PurchTotals   purchTotals;
    PurchTable   purchTable;
    container   displayFields;
    PurchtotalsForm         totalsForm;
    purchTable = PurchTable::find('000396');          
    totalsForm   = PurchtotalsForm::newPurchTotalsForm(purchTable, 1);
    totalsForm.calctotals();
    print " Total quantity = %1", totalsForm.qtyValue();
    print " Total Discount = %1",totalsForm.endDiscValue();
    print " Total Chanrges = %1",totalsForm.sumMarkUpValue(); // this includes all the freight charges..
    print " Total Invoiced = %1",totalsForm.invoiceAmountValue();
    print " Sub total      = &1",totalsForm.sumLinesValue();
    pause;
}

Regards,

Wednesday, June 18, 2014

Expression to get the line no or Serial no in SSRS

Hi,

=RunningValue(Fields!ItemId.Value, CountDistinct, "Tablix9")
Here I used ItemId as unique and table name is Tablix9;

Regards,

Sunday, June 15, 2014

How to call job to another job in axapta using x++ code

Hi,

1. Create simple job Job2  and add it to action menu item.
2. Call Job2  in other Job1 using following code.

   Args                    args; 
    ; 
    
    args = new Args(); 
    args.name(identifierStr(Job2  )); 
    new menuFunction(menuItemActionStr(Job2 ), MenuItemType::Action).run(args);
//Here Job2 in last line is the name of the menu item and in above that is name of the job

Regards,

Wednesday, June 11, 2014

Job that fetched from the current company / companytInfo table records sample in Dynamic AX

Hi,

static void CompanyInformations(Args _args)
{
    CompanyInfo   companyInfo = CompanyInfo::find();

    print  "CompanyPhone                = " +companyInfo.phone();
    print  "CompanyTeleFax              =" +companyInfo.teleFax();
    print  "CompanyGiro                 =" +companyInfo.Giro;
    print  "CompanyCoRegNum             =" +companyInfo.CoRegNum;
    print  "CompanyEnterpriseNumber     =" +companyInfo.EnterpriseNumber;
    print  "CompanyName                 =" +companyInfo.name();
    print  "CompanyAddress              =" +companyInfo.postalAddress().Address;
    print  "standardCurrency            =" +CompanyInfo::standardCurrency();
    pause;
}

Regards,

Expression to get the page no as 1 of 2 in SSRS

Hi,

=Cstr(Globals!PageNumber) & Space(2) & Labels!@SYS26401 & space(2) & Cstr(Globals!TotalPages)

Regards,

Get a table ID in SQL / table browser - D365

Hi select ID from SysTableIdView where  SysTableIdView .Name = 'CustTable' <URL>/?cmp=<CompanyID>&mi=sysTableBrowser...