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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

PopVendorItemsForm lookup in visual studio

(0) ShareShare
ReportReport
Posted on by

Hello,

I am trying to get the vendor items lookup form to open up in GP from a custom form built in Visual Studio with the Dynamics GP Addin Project.

I am currently running into a problem where once it hits the open line of the form, it just closes right away and doesn't do anything else to it from the code. I have tried many things but can't quite figure it out. I am wondering if anyone has gotten this to work within visual studio.

My code is below for the lookup. It might not all be right.

Thanks,

//show the vendor item lookup form

PopVendorItemsForm popVendorItemsForm = SmartList.Forms.PopVendorItems;
// PopVendorItemsForm.PopVendorItemsWindow popVendorItemsWindow = popVendorItemsForm.PopVendorItems.IvItemVendorLookup..PopVendorItems;

popVendorItemsForm.Open();

popVendorItemsForm.PopVendorItems.LocalVendorSortBy.Value = 1;
popVendorItemsForm.PopVendorItems.IvItemVendorLookup.SortBy.Value = 1;
popVendorItemsForm.PopVendorItems.IvItemVendorLookup.RunValidate();
popVendorItemsForm.PopVendorItems.LocalVendorSortBy.RunValidate();
//Set the ReturnToLookup flag to true so we know we called the lookup window.
GPAddIn.ReturnToVendorItemLookup = true;

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    MG-16101311-0 Profile Picture
    26,225 on at

    Try this:

               PopVendorItemsForm popVendorItems = Dynamics.Forms.PopVendorItems;
    
                if (popVendorItems.IsOpen == false) 
                {
                    popVendorItems.Open();
                }
    
                popVendorItems.PopVendorItems.IvItemVendorLookup.SortBy.Value = 1;
                popVendorItems.PopVendorItems.LocalVendorSortBy.Value = 1;
                popVendorItems.PopVendorItems.IvItemVendorLookup.VendorId.Value = "";
                popVendorItems.PopVendorItems.IvItemVendorLookup.VendorItemNumber.Value = "";
                popVendorItems.PopVendorItems.IvItemVendorLookup.ItemNumber.Value = "";
                popVendorItems.PopVendorItems.IvItemVendorLookup.VendorItemDescription.Value = "";
                popVendorItems.PopVendorItems.IvItemVendorLookup.Return.Value = 1;
    
    
                popVendorItems.PopVendorItems.LocalVendorSortBy.RunValidate();
    


    There are techniques to capture the value being returned from a Dex lookup window to a Visual Studio Tools WinForm field, but let's make sure the above works first.

  • Community Member Profile Picture
    on at

    Mariano,

    Thanks for the quick response. However, it did not solve the problem. So what happens when I debug the code, it will hit the popVendorItems.Open() line and as soon as it does it, it opens the form in GP and then right away closes it again. Its like there is another event that is fired off that is closing the form as soon as it opens. SO when I click my lookup button on my form without debugging, the vendor items form flashes on my screen for about 100 ms.

    Have you ever run into that before on other lookups?

    Thanks,

    Seth

  • Community Member Profile Picture
    on at

    vendoritems.png

    You can see on the bottom bar, its slightly open, that is after its closed after being opened for a split second.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Shravan Attelli Profile Picture

Shravan Attelli 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans