Skip to main content

Notifications

Microsoft Dynamics AX forum
Answered

D365 New Fields In Map CustVendTrans and flowing it into CustTrans Or VendTrans from LedgerJournalTrans

Posted on by 2,544

How can i add new fields in map CustVendTrans  and can flow it into  CustTrans Or VendTrans from LedgerJournalTrans.

I have already created a extension of class CustVendVoucher and want to use initCustVendTrans().

  • Verified answer
    Piyush Adhikari Profile Picture
    Piyush Adhikari 2,544 on at
    RE: D365 New Fields In Map CustVendTrans and flowing it into CustTrans Or VendTrans from LedgerJournalTrans

    Yes it seems that the feature is missing :(

    I am using the code in following way

    [ExtensionOf(classStr(CustVendVoucher))]

    final class AcxCustVendVoucher_Extension

    {

       public void post(

           LedgerVoucher _ledgerPostingJournal,

           CustVendTrans _custVendTrans,

           NoYes _approval,

           UnknownNoYes _euroTriangulation,

           boolean _withHoldTaxType,

           boolean _useSubLedger)

       {

           LedgerJournalTrans  ledgerJournalTransLocal;

           VendTrans   vendTransUpdate;

           Common  commonLocal = common;

           next post(_ledgerPostingJournal, _custVendTrans, _approval, _euroTriangulation, _withHoldTaxType, _useSubLedger);

           if (commonLocal.TableId == tableNum(LedgerJournalTrans))

           {

               ledgerJournalTransLocal = commonLocal;

               if (_custVendTrans.tableid == tableNum(vendTrans))

               {

                   ttsbegin;

                   //*******NOT Recommended*********

                   //either update in vendTrans or custtrans

                   select firstonly1 vendTransUpdate

                       where vendTransUpdate.RecId == _custVendTrans.RecId;

                   vendTransUpdate.selectForUpdate(true);

                   vendTransUpdate.DocumentNum = ledgerJournalTransLocal.accountName();

                   vendTransUpdate.doUpdate();

                   ttscommit;

                   //*******Recommended*********

                   //or insert record with reference of VendTrans.RecId into a seperate table like AcxVendTrans

               }

           }

       }

    }

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: D365 New Fields In Map CustVendTrans and flowing it into CustTrans Or VendTrans from LedgerJournalTrans

    You can't add new fields to the standard map.

    Please see this discussion for more info about workarounds: community.dynamics.com/.../281073

Helpful resources

Quick Links

Dynamics 365 Community Update

Welcome to the inaugural Community Platform Update. As part of our commitment to…

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Community Spotlight of the Month

Kudos to Mohana Yadav!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,115 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,971 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans