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
{
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);
Update product receipt posting type ledger account instead of posting profile
Hi ,
Can someone please provide inputs for the above scenario...
Was this reply helpful?YesNo
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.