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, ...
Suggested answer

legder account need to update in PO product receipt in AX 2012 R3

(0) ShareShare
ReportReport
Posted on by 30

hi all,

PO- Product receipt

I have created a PO. Confirmed and then Product receipt. It is done

Product receipt journal - Voucher - 

3187.J1.jpg

In the place of ledger account 135101 , I wants to update to ledger account 135018

To do this , I wrote in below class and method

Class - PurchPackingSlipJournalPost 

Method - UpdateJournalLine 

purchTables = PurchTable::find(purchTable.PurchId);

    if(purchTables.MiscPurchaseOrder == NoYes::Yes)
    {
        markupTables = MarkupTable::find(purchTables.ModuleType, purchTables.MarkupCode);

        if (PurchParameters::find().MiscPO== NoYes::Yes)
        {
            ledgerDimensionMerged = DimensionDefaultingService::serviceCreateLedgerDimension(markupTables.VendorLedgerDimension, purchTables.DefaultDimension);
        }
        else
        {
            ledgerDimensionMerged = DimensionDefaultingService::serviceCreateLedgerDimension(markupTables.VendorLedgerDimension);//, this.defaultDimension());
        }
    }
    else
    {
        ledgerDimensionMerged = DimensionDefaultingService::serviceCreateLedgerDimension(formletterProvider.ledgerDimensionLineAmount());//, this.defaultDimension());
    }

It is not showing the ledger account 135018 but in Markup table it is showing the ledger account 135018 and also I passed parameter

ledgerDimensionMerged = DimensionDefaultingService::serviceCreateLedgerDimension(markupTables.VendorLedgerDimension, purchTables.DefaultDimension);

Still it is showing ledger account 135101 after PO product receipt.

7701.J2.jpg

Is my above class , method and code is correct ?

Kindly let me know how to achieve this.

Please give me more shed on this.

thanks!

I have the same question (0)
  • @rp@n Profile Picture
    30 on at
    RE: legder account need to update in PO product receipt in AX 2012 R3

    can anyone help me on this please

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at
    RE: legder account need to update in PO product receipt in AX 2012 R3

    Hi @rp@n,

    I would recommend that you make a manual ledger adjustment for your account 135101.

    Trying to manipulate the data by code might not only result in technical issues with the valuation and pricing of your item but also your auditors might make problems.

    What stops you from posting a manual correction transaction e.g. in a GL journal?

    Best regards,

    Ludwig

  • @rp@n Profile Picture
    30 on at
    RE: legder account need to update in PO product receipt in AX 2012 R3

    Sorry Ludwig, not understand. 

    Kindly elaborate please 

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at
    RE: legder account need to update in PO product receipt in AX 2012 R3

    Hi @rp@n,

    You cannot simply adjust and change a purchase price variance transaction this way.

    This might create a mess in inventory valuation and accounting.

    Please talk with your colleagues who recorded the transaction and ask them to correct it via the user interface, i.e. in the AX2012 R3 without applying any code.

    Best regards,

    Ludwig

  • @rp@n Profile Picture
    30 on at
    RE: legder account need to update in PO product receipt in AX 2012 R3

    Thanks Ludwig,

    As you said  "You cannot simply adjust and change a purchase price variance transaction this way".

    You mean to say is it impossible?

    Please give me more shed on this

  • @rp@n Profile Picture
    30 on at
    RE: legder account need to update in PO product receipt in AX 2012 R3

    Hi Ludwig,

    Is it impossible to do through code , which i am trying to achieve? Is it only possible through manual?

    Kindly elaborate me please

  • @rp@n Profile Picture
    30 on at
    RE: legder account need to update in PO product receipt in AX 2012 R3

    Hi Ludwig,

    Kindly elaborate me please whether its possible or not through code.

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at
    RE: legder account need to update in PO product receipt in AX 2012 R3

    Good morning @rp@n,

    With making a code adjustment almost everything is possible.

    Yet, I would consider this (a) as illegal from an accounting / auditing perspective and (b) risky, as it might mess up your inventory valuations and result in subsequent issues that require additional corrections.

    Your accounting colleagues can make a manual correction in the AX client and I would recommend that you reach out to them and ask them to make this manual adjustment.

    Best regards,

    Ludwig

  • @rp@n Profile Picture
    30 on at
    RE: legder account need to update in PO product receipt in AX 2012 R3

    Thanks Ludwig for your quick response.

    This is new requirement from customer . So, I am working on this.

    Anyhow I have to do this.

    As technical view, is my code is correct ? And the class and method? Which I mentioned above 

    Please give me more shed on this 

  • @rp@n Profile Picture
    30 on at
    RE: legder account need to update in PO product receipt in AX 2012 R3

    Ludwig,

    I have also done code in 

    Class - InventoryMovement

    Method - UpdateLedgerAdjust

    if (this.mustBeBookedOperations())
            {
                purchLine = buffer as PurchLine;
                purchTable = PurchTable::find(purchLine.PurchId);
                markupTable = MarkupTable::find(purchTable.ModuleType, purchTable.MarkupCode);
    
                if(purchTable.MiscPurchaseOrder == NoYes::Yes)
                {
                    ledgerVoucherTransObject = LedgerVoucherTransObject::newTransactionAmountDefault(
                                                ledgerVoucherObject,
                                                this.postingOperations(),
                                                DimensionDefaultingService::serviceCreateLedgerDimension(
                                                markupTable.VendorLedgerDimension,
                                                (PurchParameters::find().MiscPO == NoYes::Yes && !PurchTable.IsLRCChargeCode(purchTable.HCLMarkupCode))? purchTable.DefaultDimension : this.defaultDimension()),
                                                CompanyInfo::standardCurrency(),
                                                -_costAmount,
                                                currencyExchHelper);
                }
                else
                {
                    ledgerVoucherTransObject = LedgerVoucherTransObject::newTransactionAmountDefault(
                                                ledgerVoucherObject,
                                                this.postingOperations(),
                                                DimensionDefaultingService::serviceCreateLedgerDimension(this.accountOperations(),this.defaultDimension()),
                                                CompanyInfo::standardCurrency(),
                                                -_costAmount,
                                                currencyExchHelper);
                }
    
            }

    Please give me more shed on this.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

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

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 678

#3
Martin Dráb Profile Picture

Martin Dráb 526 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans