web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Update product receipt posting type ledger account instead of posting profile

(4) ShareShare
ReportReport
Posted on by 17
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:
I have the same question (0)
  • PadmaJyothi Profile Picture
    17 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,047

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 885 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 592 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans