Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

Customizing posting processes

$
0
0

My understanding of the posting process (how it executes, stack flows, thru code), generically speaking, has never been really good. So I'm looking to get a general run down of how these classes work.  I am an experienced developer of AX but this has been something that has long since eluded me.  Anything FormLetter related has always confused me, AX 2012 really complicates it further with their use of "EditLines" forms.

I am attempting to customize the Post Product Receipt (Purch Packing Slip) process for a purchase order.  More specifically, I am asked to add a field on the Lines portion of the PurchEditLines form.  Looking further, the datasource PurchParmLine is the table that will be receiving the new field.  This is no problem for me to do, this I understand.  We are wanting to use the data entered in this new field to run another step in addition to the already existing posting process.  The problem is that I don't know where the posting code is.

I do know that when you click OK on this form, that it exits the form and returns to the code that called it in the first place, this has to be where the posting code is.  I know at some point PurchFormLetter.run() gets called afterward.  I also noticed that there is another class that extends from this one called PurchFormLetter_PackingSlip, but this one doesn't have a run() method, so it would seem that the posting process for this doesn't execute different code than other posting logic for other processes like Invoicing and Receipt List, which is clearly not the case, so I'm missing something.

I also notice the class FormLetterService, and the method postPurchasePackingSlip(), but this method just seems to call this.run(), which is also the same as the postPurchaseInvoice() method.  I also have no clue how this code ever executes either, it seems like AX threads this out and calls this asynchronously because when I debug and step thru the code, I never hit the FormLetterService code yet it clearly executes.  Also, breakpointing this class never has caused the debugger to catch it, I've tried both hard and soft breakpoints.  I've even attempted to breakpoint thru Visual Studio by attaching to AXServ32.exe on the AOS, but that didn't seem to hit.

All I'm trying to do at this point is to perform an additional step to the existing posting process but I also need to have access to the PurchParmLine records that have that new column data.  I'm at my wits end trying to figure out anything that avoids writing this business logic inside the clicked() method of the OK button on the PurchEditLines form; I shudder to think that's even okay to do, but I'm not seeing any other way.  It would also be nice to understand the general inner-workings of posting logic since there are many times when I'm asked to customize these areas.  I understand inheritance completely, but this is such an abstract mess that isn't documented anywhere, at least not that I'm aware of.


Viewing all articles
Browse latest Browse all 72043

Trending Articles