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

Before Purchase order - Product receipt posting, which method get called from which class ?

(0) ShareShare
ReportReport
Posted on by 30

Hi,

Can you please let me know  Before Purchase order - Product receipt posting, which method get called from which class ?

Please give me more shed on this. 

Thanks!

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    300,716 Super User 2025 Season 2 on at
    RE: BEFORE PO - PRODUCT RECEIPT , which CLASS is called?

    Hi @rp@n,

    Can you explain what you mean with "Before product receipt"? I'm not able to understand what you want to achieve.

  • @rp@n Profile Picture
    30 on at
    RE: Before Purchase order - Product receipt posting, which method get called from which class ?

    HI Andre,

    I have put the break point in FormLetterService  class - PostPurchaseOrderPackingSlip method

    Call stack - 

    6012.J1.jpg

    I have found PurchPackingSlipJournalPost - StartLines

    2627.J2.jpg

    1258.j3.jpg

    In the StartLines method having Super(), which called FormLetterJournalPost - StartLines method.

    It is mentioned, "Starts the posting for all Journal Lines"

    *** My requirement to add some code Before Product receipt posting.

    I have added the code before super() in class - PurchPackingSlipJournalPost - StartLines method ? but that is not working.

    Kindly guide me is it right place to add the code ? or need to do somewhere else.

    Please give me more shed on this.

    thanks!

  • Martin Dráb Profile Picture
    237,668 Most Valuable Professional on at
    RE: Before Purchase order - Product receipt posting, which method get called from which class ?

    Could you please tell us more about your problem than mere "I added some code and it's not working"?

    Many thanks.

  • @rp@n Profile Picture
    30 on at
    RE: Before Purchase order - Product receipt posting, which method get called from which class ?

    Hi Martin,

    Thanks for response.

    Sure, I will explain you, what I am.trying to achieve after sometime.

    Could you please confirm, is this exact place to add code ? If I wants to perform something before Purchase order - Product receipt posting.

    Please help me on this.

  • Martin Dráb Profile Picture
    237,668 Most Valuable Professional on at
    RE: Before Purchase order - Product receipt posting, which method get called from which class ?

    It depends on what exactly you mean by "before posting", therefore your question can't be answered unless you give us more information.

    For example, you may want to do something before opening the posting dialog, just before or after preparing parm data, just before or after closing the dialog, before starting the whole posting process, before posting an individual receipt (e.g. it'll be called multiple times if you're posting multiple receipts) and so on and so on.

    As usual (and as you were already told quite a few times), it would be easier if you explained your business scenario before diving into implementation details. Now we still have little idea about what you actually want.

  • @rp@n Profile Picture
    30 on at
    RE: Before Purchase order - Product receipt posting, which method get called from which class ?

    Sure Martin, one minute please

  • @rp@n Profile Picture
    30 on at
    RE: Before Purchase order - Product receipt posting, which method get called from which class ?

    Hi Martin,

    3583.P1.jpg

    Then click OK,  After Closing the dialog , *** I wants to update Ledger dimension ( main account ) before posting.

    I have wrote below code ( purchPackingSlipJournalPost - StartLines ) to update Ledger dimension ( main account ) for posting type  = PPV only before posting.  Is it right place?

    purchTables = PurchTable::find(purchTable.PurchId);
        purchParameters = purchParameters::find();
        if(purchParameters.MiscPO == NoYes::Yes)
        {
            markupTables = MarkupTable::find(purchTables.ModuleType, purchTables.MarkupCode);
            if(purchTables.MiscPurchaseOrder == NoYes::Yes)
            {          
                ledgerDimensionMerged = DimensionDefaultingService::serviceCreateLedgerDimension
                (markupTables.VendorLedgerDimension, purchTables.DefaultDimension);            
            }
        }

    Please give me more shed on this.

    thanks!

  • Martin Dráb Profile Picture
    237,668 Most Valuable Professional on at
    RE: Before Purchase order - Product receipt posting, which method get called from which class ?

    Hmm, it sounds to me like that you don't need to do anything before posting. You seem to want to change the way how ledger posting works. For some reason, you don't want to use the account configured for this type of posting and you want to take the value from somewhere else. Can you explain why, please?

    Also, your code suggests that you want to control the logic based on a field on PurchTable. This may be a problem if you're doing a summary posting of orders that have different setup, i.e. they should be posted to different accounts. Think about it.

  • @rp@n Profile Picture
    30 on at
    RE: Before Purchase order - Product receipt posting, which method get called from which class ?

    Thanks Martin,

    Don't worry on the Updating LedgerDimension ( main account ). They already have setup  etc...

    They only asked me to find the correct place to write code.

    please confirm the below things...

    1. before opening the posting dialog - If i wrote something , is considered as before posting.

    2. After closing the posting dialog - If I wrote something , is considered as after posting

    Is it correct?

  • Martin Dráb Profile Picture
    237,668 Most Valuable Professional on at
    RE: Before Purchase order - Product receipt posting, which method get called from which class ?

    I'll answer your questions, although they seem to be missing the point.

    1. Yes, but don't forget that posting can run even without any dialog.

    2. No. The posting hasn't even started when you close the dialog. It's the same as with any other RunBase/SysOperation process with a dialog. You first collect inputs in a dialog, save data to variables (a contract in case of SysOperation) and only then you start the actual process.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans