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 :
Microsoft Dynamics AX (Archived)

how to restrict dialogue box only to product receipt.

(0) ShareShare
ReportReport
Posted on by

Hi ,

i have a requirement that to add a dialogue box (yes,no) at product receipt.when i add the dialogue box.it is working fine but when i tried to create a new PO at the time of confirmation also this dialogue box is hitting that means every time when i am confirming,invoicing the dialogue is hitting.the same method is calling every time.i am not getting any clue how to restrict that dialogue box only to product receipt every time it is showing up.

Can any one help to how to restrict dialogue box only to product receipt.

*This post is locked for comments

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    it depends where you have added your code. if piece of code is being called from numerous locations, the behavior will same as its happening now.

    in order to avoid this you need to put If condition e.g. if(DocumentStatus

  • Community Member Profile Picture
    on at

    Can you please provide me any sample code to cross ref

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    we cannot provide you any sample code unless you show us what you have done.

    as we don't have any idea where you placed code and what you have written there.

    Kindly share details of what you have done, so we can suggest further accordingly

  • Community Member Profile Picture
    on at

    this is the code

    void  closeOk()

    {

       if (Box::yesNo("@ava40", DialogButton::Yes) != DialogButton::No)

       {

           if (purchParmUpdate)

               purchParmUpdate_ds.write();

           if (purchParmTable.RecId)

               purchParmTable_ds.write();

           if (purchParmSubTable)

               purchParmSubTable_ds.write();

           if (purchParmLine)

               purchParmLine_ds.write();

       }

       else

       {

           return;

       }

    super;

    }

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    okay. now kindly explain where this closeOk() has been placed...?

    on which form etc.???

  • Community Member Profile Picture
    on at

    it is in form/purcheditline/method/close ok

  • Verified answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Thank you for providing details

    you must be knowing that this form is shared by all 3 document states of PO i.e. Confirmation, Receipt List and ProductReceipt

    you can write a condition as under

    if(documentStatus == PurchStatus::Backorder)

       {

           //your logic of Box::YesNo(..............

       }

    Note: if am using BackOrder in my example which is coming form PurchStatus BaseEnum. set your condition as per your need

  • Community Member Profile Picture
    on at

    Thanks for the advice ..it worked :)

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans