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 :
Supply chain | Supply Chain Management, Commerce
Answered

Open a custom form when posting product receipt

(0) ShareShare
ReportReport
Posted on by 110

Hi expert,

Is there anyway to open a custom form when the system is posting product receipt.

For example, form Posting Product receipt, when you enable the Print product label button, the system will open form Print label setup, meanwhile posting the product receipt

pastedimage1625210193270v1.png

I want to do exactly this behavior.

Any suggestion ?

Thanks in advance

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    300,915 Super User 2025 Season 2 on at

    Hi Nguyen,

    It would require a customization. You can choose to post the product receipt in batch or directly. You can extend the application to open another form when the current one closes. When posting the receipt via the batch framework, it can open the form directly. When running via the client, the user has to wait until the posting process was completed.

  • Nguyen Do Huy Profile Picture
    110 on at

    Hi André, 

    Thanks for replying,

    My requirement is to open the form when successfully posting product receipt. So open the form when the current one closes is not enough to fulfil the requirement

    Do you have any references to do this ? 

    Thanks again

  • nmaenpaa Profile Picture
    101,160 Moderator on at

    Hi Nguyen,

    if the form must be opened only once the posting is finished, then it can't be used together with posting in batch. Is this ok for you?

  • Nguyen Do Huy Profile Picture
    110 on at

    Hi Nikolaos,

    Yes, it is ok.

    Could you please guide me how to do that ?

    Thanks

  • Nguyen Do Huy Profile Picture
    110 on at

    Hi experts,

    Is there any references to acquire the requirement ?

    Thanks in advance

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

    Hi,

    there are plenty of blogs and discussions about opening forms with x++ code, here's one: http://daxingwitheshant.blogspot.com/2015/04/opening-form-using-x-code-in-ax.html

    I suggest you to debug the product receipt posting process to find a good place where to put your code. Put a breakpoint in insert method of VendPackingSlipJour and post a product receipt. Then you'll see where the packing slip header is created, and can look for a place where the whole posting (incl. lines) is finished.

    (update: fixed typo - table is VendPackingSlipJour, not CustPackingSlipJour)

  • Nguyen Do Huy Profile Picture
    110 on at

    I know where the posting product receipt is posted. But when I put code to open the form, It return stack trace cannot run form on non interactive session. Any ideas ?

    Thanks

  • nmaenpaa Profile Picture
    101,160 Moderator on at

    That message indicates that the posting doesn't happen in your session, but instead in another asynchronous session. Which is basically the same thing as a batch. Therefore the system can't open any forms in your session at that point.

    Could you share your business requirement, perhaps there's some better solution to that?

  • Nguyen Do Huy Profile Picture
    110 on at

    My business requirement is to Open a Form when finish the process posting product receipt.

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

    Ok, thanks. Then there's no easy solution.

    But you might want to focus on figuring out how to make the posting to happen synchronously and not asynchronously (in the background). Then you can open forms.

    Also I think you might not have the actual business requirement. And as a general instruction I'd like to share this suggstion:

    Let me suggest to go back to the users and try to find what they actually want to accomplish with this form. Usually it's not that they want "a form" but rather they want to be able to make some useful contribution to some business process. Or see some useful information. And if you manage to extract this underlying business requirement, you might be able to find other solutions.

    Forms are just tools for achieving some results. I haven't heard anyone just wanting "a form". And if you know what results they want, you have more freedom and more options to fulfill that requirement.

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 > Supply chain | Supply Chain Management, Commerce

#1
Siv Sagar Profile Picture

Siv Sagar 266 Super User 2025 Season 2

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 213 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans