Helping creating new UD Form and doing lookup

I’m creating a form so the shop supervisor can force a pop-up on the MES screen for users. I could build this into the Employee form but I would like it seperate.

I’ve been following this writeup on GingerHelp to create a blank form from UD

I’m struggling with the code to do a lookup on EmpBasic table and display it on the screen. The UD field will also need to be linked to the EmpID.

I got this far, and have the search working, but I cannot populate or bind to anything in the EmpBasic table, only the UD20 table.

Tried this code that is commented out without success.

The search will not populate Name and ID on the form =(

Customization Wizard has a Simple Search that will do this for you. You can’t use the Db object within a customization in the front end.

How do you think i can link a UD to an EmpID ? I could do this on the Employee Form but i’d rather not.

Just search for the employee ID and attach it to a Key(1-5) in the UD Record.

I think thats where i’m stuck. Is it in Foreign Key Value or some code that says
UD20.Key1 == EmpID

What do you mean foreign key value?

You can have a button that searches employee and assigns the result to Key1. Using simple search wizard.

Ahh… ill try that again.

Edit:
That worked. I was using Characterxx or something before.

What am I missing that I cannot open existing UD records?
I have a search wizard for UD and for Emp Basic. I want to be able to modify existing records in the UD.

I should be able to type in the Key1 field then on text change populate the rest of the records.

You have to invoke a search

  var opts = new SearchOptions(SearchMode.AutoSearch);
  opts.NamedSearch.WhereClauses.Add("UD13", string.Format("Key1='XXXX'", curOrderDtl.OrderNum, curOrderDtl.OrderLine));

  opts.DataSetMode = DataSetMode.RowsDataSet; 
  oTrans.InvokeSearch(opts);
  oTrans.NotifyAll();