Alfasith AX

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

Tuesday, February 20, 2018

Depley packages from DEV to SAT in D365

Hi,

1. Create a package by the model that you extended.
Save to particular location (30-50 mins).

2. Log in to LCS. Select shared asset library.



3  Select Software deployment packages.
4. Add  by select the + and upload the packages and publish.
You will notify 2 packages for what you created.
5. Select the SAT environment in LCS and get in to that environment.
Get same in to the Asset Library of the SAT.
6. Then select maintain and update.
This will be in 19 steps that takes 2 hrs mins.

Thanks,

Thursday, February 15, 2018

Code to clear the cache value / Last used values in SSRS through controller class in AX 2012

Hi,


public static void main(Args _args)
{
    SrsReportRunController controller  = DASPaymentVoucherController::construct();
    controller.parmArgs(_args);
    switch(_args.menuItemName())
    {
        case menuitemOutputStr(DASReceiptVoucherReport):
        controller.parmReportName(ssrsReportStr(DASPaymentVoucher, ReceiptReport));
        break;
        case menuitemOutputStr(DASPaymentVoucherReport):
        controller.parmReportName(ssrsReportStr(DASPaymentVoucher, Report));
        break;
        case menuitemOutputStr(DASPettyCashVoucherReport):
        controller.parmReportName(ssrsReportStr(DASPaymentVoucher, PettyCashReport));
        break;
    }

    controller.parmShowDialog(true);
    controller.parmLoadFromSysLastValue(false);
    controller.startOperation();
}

Thanks,

Wednesday, February 14, 2018

Get the values from ProjProposalTotal forms in AX 2012

Hi,

static void Job83(Args _args)
{
  ProjProposalTotals      ProjProposalTotals;
    container               taxCal;
    AmountCur               taxAmount;
        ProjProposalJour projProposalJour = ProjProposalJour::find('PROP-0019');

        ProjProposalTotals  = new  ProjProposalTotals(projProposalJour);
        ProjProposalTotals.calc();
taxCal = ProjProposalTotals::displayFieldsServer(projProposalJour.RecId);
        taxAmount = conPeek(taxCal, ProjProposalTotals::posSumTax());
   
        InvoiceAmount  = projProposalJour.InvoiceAmount - taxAmount;
        TaxAmount       = taxAmount;
        CurrencyCode   = projProposalJour.CurrencyId;
        Amountstr   = Global::numeralsToTxt_UAE(projProposalJour.InvoiceAmount);
}

Regards,

Get cost to complete, Cost at complete in Project WBS in AX 2012

static void AlfasithProjWBSCost(Args _args)
{
    hierarchyTreeTable          hierarchyTreeTablePre;
    smmActivities               smmActivitiesPre;
    psaActivitySetup            psaActivitySetupPre;
    ProjWBSUpdateController     controller;
    while    select hierarchyTreeTablePre  where hierarchyTreeTablePre.HierarchyId  == 'EWIG-00032'
    {
        smmActivitiesPre  = smmActivities::findWithRecId(hierarchyTreeTablePre.RefRecId);
        psaActivitySetupPre = PSAActivitySetup::findActivityNumber(smmActivitiesPre.ActivityNumber);
        controller = new ProjWBSUpdateController(hierarchyTreeTablePre.HierarchyId,
                psaActivitySetupPre.CalendarId,
                null,
                null,
                null,
                null,
                false,
                ProjViewType::CostTrackingView,
                null,
                null,
                true);
        controller.updateOutlineNumbersAndPublishInPreOrder();
        print controller.outlineNumberFor(hierarchyTreeTablePre.ElementNumber);
        //Cost estimnation View
        print controller.actualCostFor(hierarchyTreeTablePre.ElementNumber);
        print controller.costAtCompleteFor(hierarchyTreeTablePre.ElementNumber);
        print controller.plannedCostFor(hierarchyTreeTablePre.ElementNumber);

        /*Total actualCost = controller.actualCostFor(_hierarchyTreeTable.ElementNumber);
        Total costAtComplete = controller.costAtCompleteFor(_hierarchyTreeTable.ElementNumber);
        Total costToCompleteAmount = costAtComplete - actualCost;
        */
    }
    pause;

}

Relation between PSAProjProposalProj with PSAContractLineItems in AX 2012


static void Job80(Args _args)
{
     psaProjProposalProj psaProjProposalProj;
     projOnAccTrans projOnAccTrans;
     projProposalOnAcc projProposalOnAcc;
     psaContractLineItems psaContractLineItems;
     while select psaProjProposalProj where psaProjProposalProj.ProjProposalId == "UDI-000127"//_projProposalJour.ProposalId
            join projOnAccTrans where projOnAccTrans.ProjID == PSAProjProposalProj.ProjId
                                    && projOnAccTrans.TransactionOrigin == ProjOrigin::Prepayment
            join projProposalOnAcc where projProposalOnAcc.TransId == projOnAccTrans.TransId
                                    && projProposalOnAcc.ProposalId == PSAProjProposalProj.ProjProposalId
            join psaContractLineItems
                        where psaContractLineItems.FeeProjId == psaProjProposalProj.ProjId
        {
            info(strFmt("%1",psaContractLineItems.LineValue));
        }
}

Disable/hide report parameter on form AX 2012

Hi,

There is an attribute makes this visibility control in Contrac class level.

This can be also achieve through visual studio parameters property of visibility.

[
DataMemberAttribute,
SysOperationControlVisibilityAttribute(false)
]
public AccountNum parmCustomerAccount(AccountNum  _accountNum = accountNum )
{
    accountNum = _accountNum;
    return accountNum;
}

Thanks,
Alfasith

Tuesday, February 13, 2018

Arabic letters in the report needs to be right alignment particulary in Cheque in SSRS

Hi,

Pass another filed in insert method along with your context as language by getting a values in LedgerJournalTrans values like 'en-us', 'en-ar'..

In the Alighment property of the textbox select the Horizontal  fx   with below commands.

iif(Fields!Languague.Value="en-ar","right","Left")


Query not value enum in AX 2012

Hi,

    qbrLogStatus    = qbdsDASProjLogLines.addRange(fieldnum(DASProjLogLines,ProjLogStatus));
    qbrLogStatus.value(SysQuery::valueNot(enum2str(DASProjLogStatus::Superseded)));

Thanks,

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...