Exemplo n.º 1
0
        void POPDocumentSelectButton_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 POP document number of the row selected in the scrolling window
                // of the POP document lookup.
                Microsoft.Dexterity.Applications.SmartListDictionary.PopDocumentLookupForm popLookupForm = SmartList.Forms.PopDocumentLookup;
                string popNumber = popLookupForm.PopDocumentLookup.DocumentScroll.PoNumber;

                // Display the value retrieved
                LookupsWindow.POPDocumentNumber.Text = popNumber;

                // Clear the flag that indicates a value is to be retrieved from the lookup.
                GPAddIn.ReturnToLookup = false;
            }
        }
Exemplo n.º 2
0
        public void Initialize()
        {
            // Menu to open Lookups form
            Dynamics.Forms.AboutBox.AddMenuHandler(OpenLookupWindow, "Lookups", "");

            // Select button on the Customers lookup window
            Microsoft.Dexterity.Applications.SmartListDictionary.CustomerLookupForm customerLookupForm = SmartList.Forms.CustomerLookup;
            customerLookupForm.CustomerLookup.SelectButton.ClickBeforeOriginal += new System.ComponentModel.CancelEventHandler(CustomerSelectButton_ClickBeforeOriginal);

            // Select button on the Vendors lookup window
            Microsoft.Dexterity.Applications.SmartListDictionary.VendorLookupForm vendorLookupForm = SmartList.Forms.VendorLookup;
            vendorLookupForm.VendorLookup.SelectButton.ClickBeforeOriginal += new System.ComponentModel.CancelEventHandler(VendorSelectButton_ClickBeforeOriginal);

            // Select button on the Items lookup window
            Microsoft.Dexterity.Applications.SmartListDictionary.IvItemNumberLookupForm itemNumberLookupForm = SmartList.Forms.IvItemNumberLookup;
            itemNumberLookupForm.IvItemNumberLookup.SelectButton.ClickBeforeOriginal += new System.ComponentModel.CancelEventHandler(ItemSelectButton_ClickBeforeOriginal);

            // Select button on the GL Account lookup window
            Microsoft.Dexterity.Applications.SmartListDictionary.AccountLookupForm accountLookupForm = SmartList.Forms.AccountLookup;
            accountLookupForm.AccountLookup.SelectButton.ClickBeforeOriginal += new System.ComponentModel.CancelEventHandler(AccountSelectButton_ClickBeforeOriginal);

            // Select button on the SOP Document lookup window
            Microsoft.Dexterity.Applications.SmartListDictionary.SopDocumentLookupForm sopLookupForm = SmartList.Forms.SopDocumentLookup;
            sopLookupForm.SopDocumentLookup.SelectButton.ClickBeforeOriginal += new System.ComponentModel.CancelEventHandler(SOPDocumentSelectButton_ClickBeforeOriginal);

            // Select button on the POP Document lookup window
            Microsoft.Dexterity.Applications.SmartListDictionary.PopDocumentLookupForm popLookupForm = SmartList.Forms.PopDocumentLookup;
            popLookupForm.PopDocumentLookup.SelectButton.ClickBeforeOriginal += new System.ComponentModel.CancelEventHandler(POPDocumentSelectButton_ClickBeforeOriginal);

            // Validate script that prevents the POP Document lookup window from being displayed
            popLookupForm.PopDocumentLookup.PopPoLookup.ValidateBeforeOriginal += new System.ComponentModel.CancelEventHandler(PopPoLookup_ValidateBeforeOriginal);
        }
Exemplo n.º 3
0
        private void POPDocumentLookup_Click(object sender, EventArgs e)
        {
            // Create a reference to the PopDocumentLookup form
            Microsoft.Dexterity.Applications.SmartListDictionary.PopDocumentLookupForm popLookup = SmartList.Forms.PopDocumentLookup;

            // Set the flag indicating that we opened the lookup
            GPAddIn.ReturnToLookup = true;

            //Open the lookup form
            popLookup.Open();

            // Set the field values on the lookup window
            popLookup.PopDocumentLookup.IncludeGb.Value            = 0; // 0 = Open docs, 1 = History
            popLookup.PopDocumentLookup.LocalSortBy.Value          = 1;
            popLookup.PopDocumentLookup.PopPoLookup.PoNumber.Value = POPDocumentNumber.Text;

            //Run Validate on the SortBy field to fill the lookup window
            popLookup.PopDocumentLookup.LocalSortBy.RunValidate();
        }