Page 1 of 1

Add a lookup button to Notes grid in P/O and S/O

PostPosted: Wed Apr 17, 2019 9:09 pm
by pricerc
So we now have a (potentially) many-to-many relationship between sales orders and purchase orders.

In practice, one sales order may have multiple purchase orders, or one purchase order may have multiple sales orders.

We're happily storing these as text in a Notes field on the respective screens, and that's working fine, and I can add notes either programmatically, or by just typing the corresponding OrderNo in the notes field.

So the question is: can I add a 'lookup' button column to the notes grid? It's not desperately needed, but it would be kinda cool if when a user picks a note type of "Related Purchase Order", I could enable a lookup button that fires off a Purchase Order Search.

Re: Add a lookup button to Notes grid in P/O and S/O  Topic is solved

PostPosted: Thu Apr 18, 2019 9:31 am
by SBarnes
Hi Ryan

If you know the name of the grid the following is an example of how to do it

Code: Select all
jgLines.AddColumn("PartNoLU", new  JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaLookupButtonCellType(Manager) {Text = ""}, "", 15, false, true, false,false);


you then also need to do the button clicked event for the grid which looks like this

Code: Select all
private void jgLines_ButtonClicked(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
      {
         //System.Diagnostics.Debugger.Launch();
         


         if(e.Column == PartNoLUColumn)
         {
            string result =  SearchInventory(this);
             if(result != "")
            {
                                  

            }
         }
         
      }



and you will need to hook this up somewhere.

Re: Add a lookup button to Notes grid in P/O and S/O

PostPosted: Thu May 02, 2019 11:18 pm
by Knarr
What's the best place to hook something like this up, Stuart?