GetByID loads record but does not make it active

I’m working in the classic version and have used identical code in numerous places. I’m trying to load a specific record when a form loads (normally I’m using LaunchFormOptions and feeding the information in).
In this case, even when I hard code the information, it is loading the record, but not making it active.
I’m using this:
this.oTrans_adapter.ClearData();
this.oTrans_adapter.GetByID(key1,key2,“”,“”,“”);
oTrans.Update();
oTrans.NotifyAll();

And it is loading the record, it is not however making it the active record. On all other forms I’ve done this on, it not only loads but makes it the active record. This is on a form built off of UD29 but I have used this method in multiple other UD table forms. Is there a command to make a record in the tree the active record?


image

If I click on it in the tree, it becomes the active record but need it to do that without opening the tree and clicking on the record.
image

Find out what row you are and set the row. :popcorn:

1 Like

Is there a SetActiveRow command or something similar? I’m always going to be wanting the first record in this case so if I can do something like edvUD29.SetActiveRow(0); that would be perfect.
It’s not SetActiveRow, so do you by chance know the correct syntax?

Figured it out thank to Kevin:

		edvUD29.Row = 0;
1 Like

Now note, I do not know if that’s the proper way to do it.
That may have side effects on other forms, but for UD29 I would guess you are fine.

On other forms, I haven’t had this trouble. Every other form I’ve done this on automatically sets the one called by GetByID to the current row.

This one was on the top of my head because I just had to do it.
Made my own EpiDataView for something and it didn’t have it’s row set.

No matter what you might have said, this is what I read…

Do It Lets Get This Done GIF