Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Dynamics GP Visual Studio Tools PopPrintPurchasingDocumentsForm

(1) ShareShare
ReportReport
Posted on by 540

Hi,

I'm trying to capture the print button events of the PopPrintPurchasingDocumentsForm form but is not working. It only works if I don't have any restriction selected. When debug with visual studio and click the print button, the breakpoint is not stopping in those events.

This is the code that I'm using. 

internal static Microsoft.Dexterity.Applications.MultiEntityManagementDictionary.PopPrintPurchasingDocumentsForm PopPrintPurchasingDocumentsForm;

public void Initialize()
{

PopPrintPurchasingDocumentsForm = Dynamics.Forms.PopPrintPurchasingDocuments;
PopPrintPurchasingDocumentsForm.PopPrintPurchasingDocuments.PrintButton.ClickBeforeOriginal += PrintButton_ClickBeforeOriginal;
PopPrintPurchasingDocumentsForm.PopPrintPurchasingDocuments.PrintButton.ClickAfterOriginal += PrintButton_ClickAfterOriginal;
PopPrintPurchasingDocumentsForm.PopPrintPurchasingDocuments.PrintBeforeOriginal += PopPrintPurchasingDocuments_PrintBeforeOriginal;

}

private void PrintButton_ClickAfterOriginal(object sender, EventArgs e)
{
throw new NotImplementedException();
}

private void PopPrintPurchasingDocuments_PrintBeforeOriginal(object sender, System.ComponentModel.CancelEventArgs e)
{
var g = PopPrintPurchasingDocumentsForm.PopPrintPurchasingDocuments.LocalRestrictions.Value;
e.Cancel = true;
}

private void PrintButton_ClickBeforeOriginal(object sender, System.ComponentModel.CancelEventArgs e)
{
var g = PopPrintPurchasingDocumentsForm.PopPrintPurchasingDocuments.LocalRestrictions.Value;
e.Cancel = true;
}

Categories:
  • Suggested answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,004 User Group Leader on at
    RE: Dynamics GP Visual Studio Tools PopPrintPurchasingDocumentsForm

    try this

    using System.Windows.Forms;

    public static Microsoft.Dexterity.Applications.DynamicsDictionary.PopPrintPurchasingDocumentsForm.PopPrintPurchasingDocumentsWindow poPrint =
    Dynamics.Forms.PopPrintPurchasingDocuments.PopPrintPurchasingDocuments;

    poPrint.PrintButton.ClickBeforeOriginal += PrintButton_ClickBeforeOriginal;

    private void PrintButton_ClickBeforeOriginal(object sender, System.ComponentModel.CancelEventArgs e)
    {
    //throw new NotImplementedException();
    MessageBox.Show(poPrint.LocalRestrictions.Value.ToString());
    e.Cancel=true;

    }

  • Edson Velez Profile Picture
    Edson Velez 540 on at
    RE: Dynamics GP Visual Studio Tools PopPrintPurchasingDocumentsForm

    Hi,

    Sorry this is the correct code

    internal static Microsoft.Dexterity.Applications.DynamicsDictionary.PopPrintPurchasingDocumentsForm PopPrintPurchasingDocumentsForm;

    I'm using the Dynamics Dictionary.

    Thanks,

    EV

  • Suggested answer
    RE: Dynamics GP Visual Studio Tools PopPrintPurchasingDocumentsForm

    I tried looking for more for this as well, but as mentioned, as we don't do any testing with third party products, i.e. MEM, we don't have this information.

    Have you tried contacting support on the MEM side to see if they had anything to offer?

    Thanks

  • Almas Mahfooz Profile Picture
    Almas Mahfooz 11,004 User Group Leader on at
    RE: Dynamics GP Visual Studio Tools PopPrintPurchasingDocumentsForm

    I don't have MEM installed, otherwise I would try this for you. :(

  • RE: Dynamics GP Visual Studio Tools PopPrintPurchasingDocumentsForm

    I am unable to advise on this one, so hopefully the community can help you out.  If not, you may want to open a Support case for further assistance. Thank you in advance.

    Cheryl

    Microsoft Support - GP Apps team

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans