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
    }

//}

No comments:

Post a Comment