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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Capturing PackingSlip Posting Event in COC

(0) ShareShare
ReportReport
Posted on by 10

Hello,

I need to perform a certain task after the posting of the packing slip is completed with or without errors. I successfully captured to event preceding the posting by extending the clicked method of the "OK" button on the "SalesEditLines" form:

pastedimage1606903176520v1.png

After clicking ok on the above screen and clicking ok on the below dialog:

pastedimage1606903398949v2.png

I need to be able to perform a task after the below dialog is completed:

pastedimage1606903457938v3.png

How can I do this?

Thank you in advance,

I have the same question (0)
  • Bala Chandra Profile Picture
    355 on at

    Hi Najib,

    You can check business events

  • Najib.Saad Profile Picture
    10 on at

    Sorry, but can you give me more details?

  • Bala Chandra Profile Picture
    355 on at

    You can get more details in the below link

    docs.microsoft.com/.../home-page

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Najib,

    What operation do you need to perform after posting packing slip? Form SalesEditLines is called during other processes like Confirmation as well. So, doing a CoC here probably won't work for you.

    You can try doing a CoC on insert method of CustPackingSlipJour. Records are inserted into this table after a packing slip is generated successfully.

  • Bala Chandra Profile Picture
    355 on at

    If business events not suite your requirement then you can check class SalesFormLetter and methods like run.

  • Najib.Saad Profile Picture
    10 on at

    I am changing the item group before posting based in a certain condition then I need to revert it back to its original value after posting (in both success and failed cases).

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi Najib.Saad,

    The is a method SalesPackingSlipJournalPost.endPost that indicates that the packing slip was posted and you can create CoC for it to add your own post-event code.

  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    Hi Najib,

    as others suggested, you should hook your code in the actual business process or inserting of the packing slip, instead of a button on a form. This way you can also be sure that your code is triggered always when packing slips are created, not only when they are created via the dialog.

  • Suggested answer
    Najib.Saad Profile Picture
    10 on at

    Hello guys, thank you for your responses, you guided me to finding the solution, I wrapped the event postSalesOrderPackingSlipProject in the class FormLetterService in CoC and got the desired outcome.

    [ExtensionOf(classStr(FormLetterService))]
    final class FormLetterService_Extension
    {
    FormletterOutputContract postSalesOrderPackingSlipProject(SalesFormLetterPackingSlipProjContract _contract)
    {
    //ACTION BEFORE POSTING
    
    FormletterOutputContract formLetterOutputContract = next postSalesOrderPackingSlipProject(_contract);
    
    // ACTION AFTER POSTING
    
    return formLetterOutputContract;
    }
    }

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 503 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans