UD100 GetByID

Here’s what I hope will be an easy one for the programmers out there…

I’ve written a simple customization for the UD100 table (and ud100a child) where a button creates a “new ticket” via oTrans.GetNew(). That’s fine enough, I can populate the key fields etc. and create new records.

My challenge is, after the GetNew (but before that new record is committed to the DB), the user can elect to retrieve an existing ticket using a couple text boxes etc. I then use a GetByID() to retrieve that record.

It all essentially works fine but…

  1. The system maintains a list of all the newly created records in the Navigation bar. This is not desire, but okay.
  2. When I delete one of the child records for the current record, Epicor performs the updates, but drops back to the first record in the list.

I can get back to the most recently added record easily enough via the navigation bar, but it’s as though the system loses track of the current record.

When I run a trace, I can see my activity all the way through updating my last record, and then the system does a ClearData, a ResetList, and a GetByID for the first record – thereby changing my current record.

So that’s weird, but my question is… Is there a way to set the CurrentDataRow? Or do I need to run a particular oTrans method to cause it to forget all but the last record I created (preferred)?

Thanks in advance

Update1: I just noticed that, at the top of the customized page; in the navigation bar, the first record I created is always displayed. As though the system doesn’t consider any new records as the "current record". I think that’s why, whenever “it” refreshes, that first record is the one that is displayed.*

Update2: Well this is embarrassing… it seems the application maintains an EpiDataView called ListView. That object is a list of my records and it appears to be the binding source for the Nav bar.

So… I’m guessing I have to manage that thing somehow - I would have thought it’d track along with my UD100 EpiDataView as far as current record. Apparently not.

Any best practice out there for synchronizing the movement through the list and the UD table? Strange that I would have to do that.

Can you give us the end goal, as well as show you what you have so far? and demonstrate the issue?

I’m happy to, but it really is a lot of spaghetti (not as simple as I said it was)…
The end goal is to have a record in view, without the system keeping track of the 154 that I created in this session.

Once that list builds beyond 1 record, everytime the system “refreshes”, it “gets” the first record in that list. Is there a way to simply remove the contents of that Listview? I have no interest in retaining a list of all the records I’ve created. I just want to create a record, create another, retrieve an old record, and having that record I’m looking at be the only record in the navigation list.

private void UD100_AfterFieldChange(object sender, DataColumnChangeEventArgs args)// Update NetWgt, Lck/Unlk the record & handle P-Ticket selection
{
	switch (args.Column.ColumnName)
	{
		case "ShortChar09":
			{
				if((string)args.ProposedValue == "H")
				{
					this.mdiChkLoadPersist.Checked = true;
				}
				else
				{
					if((string)args.ProposedValue == "P" && this.newTicket)  // If this is a new Tkt AND user opts to retrieve an old tkt
					{
						getPTicketNum())

Why dont you clear the screen between records?

Sounds promising… and would that be the same as if I pressed the “eraser”? That is the functionality I would like - each record starts from ground zero.

Care to recommend a syntax? I have a Form, a Transaction, Session, and probably a few other objects. I am not directly addressing the UD100 adapter - it’s easier to manage (for me) through the transaction.

and epiDataViews for UD100 and for UD100a

Update: Uh oh… I just realized, you’re suggesting I press the clear button/icon between records. I’m trying to find a way to do this programmatically. This will be used by warehouse personnel with instructions on using 4 buttons. I really don’t want a user to have to even think about the menu.

So, no way to programmatically execute that clear?

oTrans.Clear();

Hmm… Thought I tried that… I’ll try it again.

Yeah, that Clear doesn’t seem to do anything.
I have a messagebox, then the Clear runs, and I still have 2 records in my nav list. Nothing clears. Do I have to do a notifyall?

Try oTrans.ClearDataSets()?

1 Like

Whoah! That’s a sledgehammer. It works. Left me with a white screen so now I have to do some cleanup, but this is exactly what I want. Thanks Jose. I appreciate the assist!