Sunday, February 1, 2015

Multiple PDC(Post Dated Cheques) Settlement In Ax 2012

Hello guys,

Problem :

In Ax 2012 R2 we don't have functionality to post multiple PDC's at one go

Solution :

We need a simple customization to enable this functionality

Steps :

-> Go to AOT->Forms-> VendPostDatedChecks->Designs->ActionPaneTab->SettleClearingTransaction

-> open properties of "SettleClearingTransaction" and change property "Multiselect" to "Yes"
-> In form design Go to ListPageGrid properties and change "Autodeclaration" to "Yes"
-> copy and paste the below code in Click method in "SettleClearingTransaction" button.


void clicked()
{
    //NS - Added by Rahul for multiselect posting option
    boolean multiSelected;
    CustVendPDCRegister _custVendPDCRegister,custVendPDCloc;
    super();
    if(CustVendPDC_ds.anyMarked())
    {
        _custVendPDCRegister = CustVendPDC_ds.getFirst(true);
        while(_custVendPDCRegister)
        {
            custVendPDCloc =            CustVendPDCRegister::findByReference(_custVendPDCRegister.LedgerJournalTrans);
            if(custVendPDCloc.PDCStatus == PostDatedCheckStatus::Posted)
            {
                CustVendPDCManager::settleClearingTransactions(custVendPDCloc);
                multiSelected = true;
            }
            _custVendPDCRegister = CustVendPDC_ds.getNext();
        }

    }
    if (multiSelected)
    {
        CustVendPDC_ds.research();
        CustVendPDC_ds.first();
        CustVendPDC_ds.mark(0);
        ListPageGrid.setFocus();
    }
    else
    {
        CustVendPDC_ds.reread();
        CustVendPDC_ds.active();
    }
        //NE - Added by Rahul for multiselect posting option
}


@Rahul Talasila






No comments:

Post a Comment

Why do users often get confused about Dynamics 365 Customer Engagement (D365 CE), Dataverse, and the Power Platform?

  The Microsoft ecosystem for business applications can sometimes be difficult to navigate, especially when discussing Dynamics 365 Customer...