void VendorSelectButton_ClickBeforeOriginal(object sender, System.ComponentModel.CancelEventArgs e) { // Run this code only if the Visual Studio Tools add-in opened the lookup. if (GPAddIn.ReturnToLookup == true) { // Retrieve the vendor ID of the row selected in the scrolling window // of the Vendors lookup. VendorLookupForm vendorLookupForm = SmartList.Forms.VendorLookup; string vendorID = vendorLookupForm.VendorLookup.VendorLookupScroll.VendorId; string vendorName = vendorLookupForm.VendorLookup.VendorLookupScroll.VendorName; // Display the value retrieved VvfModified.Forms.GlTransactionEntry.GlTransactionEntry.LocalStrVendorId.Value = vendorID; VvfModified.Forms.GlTransactionEntry.GlTransactionEntry.LocalStrVendorName.Value = vendorName; // Clear the flag that indicates a value is to be retrieved from the lookup. GPAddIn.ReturnToLookup = false; GLTrxEntryWindow.IsChanged = true; } }
void VendorID_Lookup_BeforeOriginal(object sender, System.ComponentModel.CancelEventArgs e) { // Create a reference to the VendorLookup form VendorLookupForm vendorLookup = SmartList.Forms.VendorLookup; // Set the flag indicating that we opened the lookup GPAddIn.ReturnToLookup = true; // Open the VendorLookup form vendorLookup.Open(); // Set the field values on the lookup window vendorLookup.VendorLookup.VendorId.Value = VvfModified.Forms.GlTransactionEntry.GlTransactionEntry.LocalStrVendorId.Value; vendorLookup.VendorLookup.VendorName.Value = ""; //Vendor Name vendorLookup.VendorLookup.VendorClassId.Value = ""; //Vendor Class vendorLookup.VendorLookup.UserDefined1.Value = ""; //User Defined 1 vendorLookup.VendorLookup.VendorSortBy.Value = 2; //Sort by 1 = VendorID, 2 = VendorName // Run Validate on the Vendor Sort By to fill the lookup window vendorLookup.VendorLookup.VendorSortBy.RunValidate(); }
public void Initialize() { VvfModified.Forms.GlTransactionEntry.GlTransactionEntry.LocalCustomerIdLookup.ClickBeforeOriginal += new System.ComponentModel.CancelEventHandler(CustomerID_Lookup_BeforeOriginal); VvfModified.Forms.GlTransactionEntry.GlTransactionEntry.LocalVendorIdLookup.ClickBeforeOriginal += new System.ComponentModel.CancelEventHandler(VendorID_Lookup_BeforeOriginal); // Select button on the Customers lookup window CustomerLookupForm customerLookupForm = SmartList.Forms.CustomerLookup; customerLookupForm.CustomerLookup.SelectButton.ClickBeforeOriginal += new System.ComponentModel.CancelEventHandler(CustomerSelectButton_ClickBeforeOriginal); // Select button on the Vendors lookup window VendorLookupForm vendorLookupForm = SmartList.Forms.VendorLookup; vendorLookupForm.VendorLookup.SelectButton.ClickBeforeOriginal += new System.ComponentModel.CancelEventHandler(VendorSelectButton_ClickBeforeOriginal); GLTrxEntryWindow.SaveButton.ClickBeforeOriginal += new System.ComponentModel.CancelEventHandler(GLTrxEntryWindow_SaveButton_ClickBeforeOriginal); GLTrxEntryWindow.SaveButton.ClickAfterOriginal += new System.EventHandler(GLTrxEntryWindow_SaveButton_ClickAfterOriginal); GLTrxEntryWindow.BeforeModalDialog += new System.EventHandler <BeforeModalDialogEventArgs> (GLTrxEntryWindow_BeforeModalDialog); GLTrxEntryWindow.AfterModalDialog += new System.EventHandler <AfterModalDialogEventArgs>(GLTrxEntryWindow_AfterModalDialog); GLTrxEntryWindow.PostButton.ClickBeforeOriginal += new System.ComponentModel.CancelEventHandler(GLTrxEntryWindow_PostButton_ClickBeforeOriginal); GLTrxEntryWindow.JournalEntry.Change += new System.EventHandler(GLTrxEntryWindow_JournalEntry_Change); GLJEInquiryWindow.JournalEntry.Change += new System.EventHandler(GLJEInquiryWindow_JournalEntry_Change); }