custom lookup popup  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

custom lookup popup

Postby Riyaz » Wed Aug 21, 2019 10:27 am

Hi There

We have a requirement to create a custom lookup window similar to the attached one, can you pls provide an example
Attachments
image (2).png
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: custom lookup popup  Topic is solved

Postby SBarnes » Wed Aug 21, 2019 12:54 pm

If by similar you mean your own search display then something like below will do it, which is an example for setting a system setting, the secret to it is make your ID field the first field with a width of zero.

Code: Select all
var search = BusinessLogicHost.Manager.Search;

            search.Clear();
            search.Caption = "Document Type";

            var searchOption = new JiwaFinancials.Jiwa.JiwaApplication.JiwaSearch.SearchOption();
            searchOption.Title = "Document Type";

         
            searchOption.SQLStr = @"SELECT SY_DocumentTypes.RecID, SY_DocumentTypes.DocumentDescription                     
                                   FROM SY_DocumentTypes";
         if (SystemSetting.IDKey != "InvCatFID" )
         {
            searchOption.SQLStr += " where DocumentType = 'JiwaFinancials.Jiwa.JiwaDebtors.Debtor'";
         }
         else
         {
            searchOption.SQLStr += " where DocumentType = 'JiwaFinancials.Jiwa.JiwaInventory.Inventory'";
         }
            
            searchOption.OrderBy = @"ORDER BY SY_DocumentTypes.DocumentDescription";
            searchOption.AddColumn("RecID", Microsoft.VisualBasic.VariantType.String, "", 0, 1);
         searchOption.AddColumn("Document Description", Microsoft.VisualBasic.VariantType.String, "", 100, 2);
            search.AddSearchOption(ref searchOption);

            if (search.Show(null) == DialogResult.OK)
            {
                if (search.Results.Count > 0)
                {
                    var idField = (JiwaFinancials.Jiwa.JiwaApplication.JiwaSearch.Field)search.get_Fields(1);
                    SystemSetting.Contents = idField.FieldValue.ToString();
               var DescriptionField = (JiwaFinancials.Jiwa.JiwaApplication.JiwaSearch.Field)search.get_Fields(2);
               //var PrinterNameField = (JiwaFinancials.Jiwa.JiwaApplication.JiwaSearch.Field)search.get_Fields(3);
               
               SystemSetting.DisplayContents =  DescriptionField.FieldValue.ToString();               
                }
            }
            else
            {
                throw new JiwaFinancials.Jiwa.JiwaApplication.Exceptions.ClientCancelledException();
            }
         
         
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: custom lookup popup

Postby Riyaz » Tue Aug 27, 2019 12:17 am

Thanks Stuart,that helped
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2


Return to Technical and or Programming

Who is online

Users browsing this forum: Google [Bot] and 6 guests