Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Update product receipt posting type ledger account instead of posting profile

(3) ShareShare
ReportReport
Posted on by 6
Hi ,
 
In D365 FO , I want to update the purchase order product receipt posting type Purchase expenditure, un-invoiced ledger account as from my purchline.customfield account instead of inventposting profile account. 
I am trying to update in inventposting.accountItemLedgerDimensionFromParameters() but this is applying for both purchase expenditure un-invoiced and for purchase accrual(business unit and cost center values). I want to override purchase expenditure, un-invoiced for both item and procurement category type purchase order.
please help me.
Please find the attached screens for standard ledger account and my custom values.
 
My custom code for Debit Ledger account (Posting type: purchase expenditure, un-invoiced):
[ExtensionOf(TableStr(InventPosting))]
internal final class InventPostingTable_Extension
{
 public static LedgerDimensionDefaultAccount accountItemLedgerDimensionFromParameters(InventPostingAccountItemLedgerDimensionParameters _searchParameters)
 {
     LedgerDimensionDefaultAccount ret;
     ret = next accountItemLedgerDimensionFromParameters(_searchParameters);  
     if (_searchParameters.AccountType == InventAccountType::PurchPackingSlipOffsetAccount)
     {
         ret = ******* ;  // (RecId of  604500-002-023-011-AudioRM)  
     }
     return ret;
 }
}
My custom code for Credit ledger account (Posting type: purchase expenditure, un-invoiced):
[ExtensionOf(classStr(InventMovement))]
internal final class InventMovement_Extension
{
protected LedgerVoucherTransObject initializeLedgerVoucherTransPostingTransactionTmp(LedgerVoucherObject _ledgerVoucherObject,LedgerPostingType _postingType,
LedgerDimensionAccount _ledgerDimensionId,CurrencyCode _standardCurrencyCode,Money _transactionCurrencyAmount,CurrencyExchangeHelper _currencyExchHelper,
LedgerPostingTransactionTmp _transaction)
{
    LedgerVoucherTransObject    ret;
    PurchLine                   purchLine;
    select firstonly purchLine
    where purchLine.InventTransId == this.transId();
    if (purchLine.Customfield && _postingType == LedgerPostingType::PurchOffsetAccountPckSlp)
    {
        //_ledgerDimensionId = **** ; //(recid of 604500-002-023-011-AudioRM)
        _ledgerDimensionId = purchLine.Customfield;

    }
    ret = next initializeLedgerVoucherTransPostingTransactionTmp(_ledgerVoucherObject,_postingType,_ledgerDimensionId,_standardCurrencyCode
    ,_transactionCurrencyAmount,_currencyExchHelper,_transaction);
    return ret;
}
}
Categories:
  • PadmaJyothi Profile Picture
    PadmaJyothi 6 on at
    Update product receipt posting type ledger account instead of posting profile
    Hi ,
     
    Can someone please provide inputs for the above scenario...

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,759 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,468 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans