Porting Customization from E9 to E10

In MES on E9, I have a button labeled LunchOut, and when an employee clicks this button, I have a customization that runs and adds sets the value of UD Checkbox01 to “True” for each Labor Activity that has ActiveTrans set to True. It does this in both LaborHed and LaborDtl. In that same process, it ends the activity on each LaborDtl that was an ActiveTrans. I have ported this over to E10 and it seems to be working flawlessly.

Also in E9, when a user logs back in after lunch, MES automatically logs them back into the jobs that they were in when they lunched out. This is done by looking for rows that have CheckBox01 set to True for that EmployeeNum in LaborHed and LaborDtl.

Here is the code from E9 that is working as it should for the LunchIn process:

Doing this in E10 is proving to be, well, challenging. The main reason for this is that I did not write the E9 code. I have done customizations in E9, but never really worked with Adapters and Business objects until E10. So, I am having to teach myself as I go.

I have successfully ported the LunchOut procedure from E9 to E10, but the LunchIn is throwing me for a loop.

Below is the beginning of my LunchIn() routine (the E10 version), and this is where I am getting stuck.

Dim l As New LaborAdapter(oTrans)
Dim queryHead As String = String.Format("EmployeeNum = '{0}' and CheckBox01 = true", GetEmployeeId())
Dim opts As Ice.Lib.Searches.SearchOptions = New Ice.Lib.Searches.SearchOptions(Ice.Lib.Searches.SearchMode.AutoSearch)
opts.DataSetMode = Ice.Lib.Searches.DataSetMode.RowsDataSet
opts.PreLoadSearchFilter = queryHead
Dim ds As Erp.BO.LaborDataSet = l.LaborData
Dim DidLunchIn As Boolean = False
If ds IsNot Nothing AndAlso ds.LaborHed.Rows.Count > 0 Then
	ds.LaborHed.Rows(0)("CheckBox01") = False

The next line in the E9 customization is:

Dim newDetailDS = l.GetRows(String.Format("EmployeeNum = '{0}' and ActiveTrans=yes", GetEmployeeId()), String.Empty, String.Empty, "", "", "", "", "", "", "", "", "", 0, 0, False)

I would then be able to reference that using newDetailDS.LaborHed.Rows(0)…

However, in E10, .GetRows is delcared as GetRows(searchOpts, morePages). If I try to use l.GetRows in E10, it locks up and I have to forcefully close out MES and restart it.

Dim opts2 As Ice.Lib.Searches.SearchOptions = New 
opts2.DataSetMode = Ice.Lib.Searches.DataSetMode.RowsDataSet
queryHead = String.Format("EmployeeNum = '{0}' and ActiveTrans=yes", GetEmployeeId())
opts2.PreLoadSearchFilter = queryHead
Dim newDetailDS As Erp.BO.LaborDataSet = l.GetRows(opts2, False)

Can someone (@josecgomez :grin:) point me in the right direction? Am I on the right path here or did I turn myself around too many times and get completely lost?