Monday, 11 November 2013

listpage enabling override methods(How to write methods on the list page Form in Ax 2012)

for enabling default override methods in list page we will set on property to group as

display target-- client(defautly it is auto we can change as client)




Scenario: I have a menu item that calls some class to do manipulation on the list page Form and I need to refresh the list page now. List pages do not allow writing of code on the Form, as they used interaction class.
Solution: You can write the code on list page buttons by setting DisplayTarget property to “Client” from auto. However after this change, you won’t be able to sue this button on the EP, so if you are thinking of using the same list page on the EP and planning to use the same button there, then do not do it. However f your domain is only the Form then you are good to do this.
Any ways override the clicked method and call research() of the data source to do this

Thursday, 7 November 2013

how to getting the show button in info box while posting journal......

how to getting  the show button in info box while posting journal......
if we click on that show button its go to that current journal record..

When the general journal posted info box opened
Here we click on show button its go to current journal record.
For this functionality we can follow this procedure
Create one int64 field in ledgerjournal table(ex: TransferRefRecId)
And give the relation in ledgerjournal table to what ever table ur using that table(ex:I used the InventTransferTable)
(Then I am giving the relation as ledgerjournaltable. TransferRefRecId == InventTransferTable.recid)
After that where the journal posting method u write this following code
info(strfmt("%1", journalTable.parmJournalNum()),'',SysInfoAction_TableField::newBuffer( LedgerJournalTable));


example:

in my form I wrote the journal posting method in form methods as


//[SysEntryPointAttribute(true)]
public void createGeneralJournalAndPost(Amount _shipnow)
{
    AxLedgerJournalTable    journalTable;
    AxLedgerJournalTrans    journalTransCredit,journalTransDebit;
    container               acctPattern;
    container               offSetAcctPattern;
    LedgerJournalTable      ledgerJournalTable,ledgerJournalTableUpdate;
    ledgerJournalCheckPost  ledgerJournalCheckPost;
    LedgerJournalTable      ledgerjournalTableDelete;
    LedgerJournalTrans      journalTransDelete;
    SalesParameters         SalesParameters;//JournalNameId;
    DimAttributeCustTable   DimAttributeCustTable;
    DimensionAttributeValueCombination valueCombination;
    CustInvoiceTable        custInvoiceTable;
    LedgerParameters        LedgerParameters;
    System.Exception        ex;
    str                     errorStr;
    LedgerJournalId         journalId;
    LedgerJournalPost       LedgerJournalPost;
    InventParameters        InventParameters;
    Amount                  markvalue;
    InventTransferTable InventTransferTable1;
    str s;

           markvalue = InventTransferTable.markupvalue(_shipnow);

            journalTable = new AxLedgerJournalTable();
            journalTransCredit = new AxLedgerJournalTrans();

              InventParameters = InventParameters::find();
            journalTable.parmJournalName(InventParameters.JournalNameId);
           // journalTable.parmTransferRecId(InventTransferTable.RecId);
            journalTable.parmDefaultDimension(InventTransferTable.DefaultDimension);
            journalTable.save();

            ledgerJournalTable = journalTable.ledgerJournalTable();

            ttsBegin;
            select forUpdate ledgerJournalTableUpdate  where ledgerJournalTableUpdate.JournalNum == ledgerJournalTable.JournalNum;
            ledgerJournalTableUpdate.TransferRefRecId = InventTransferTable.RecId;
            ledgerJournalTableUpdate.update();
            ttsCommit;
            journalTransCredit.parmJournalNum(ledgerJournalTable.JournalNum);

            journalTransCredit.parmTransDate(systemDateGet());
            journalTransCredit.parmAmountCurCredit(round(markvalue,2));
            journalTransCredit.parmAccountType(LedgerJournalACType::Ledger);
            journalTransCredit.parmLedgerDimension(InventParameters.RevenueDimension);
            journalTransCredit.parmDefaultDimension(InventTransferTable.DefaultDimension);
            LedgerParameters = LedgerParameters::find();
            journalTransCredit.parmOffsetLedgerDimension(InventParameters.LedgerDimension);

            journalTransCredit.save();

            ledgerJournalCheckPost              = LedgerJournalCheckPost::newLedgerJournalTable(ledgerJournalTable,Noyes::Yes);
            ledgerJournalCheckPost.run();
            //if (this.showInfo())
            //info(strFmt("%1,%2-%3",journalTable.parmJournalNum(),journalTransCredit.parmVoucher(),SysInfoAction_TableField::newBuffer(LedgerJournalTable)));
info(strfmt("%1", journalTable.parmJournalNum()),'',SysInfoAction_TableField::newBuffer(LedgerJournalTable));
//////////////////this above line I wrote for showing show button
    }

//}