GetByID return is a bool?

In 2022.2.17, I have code that simply uses .GetByID to get a dataset, just as it’s been done for a while:

Erp.BO.ServiceCallCenterDataSet SvcCallDS = new Erp.BO.ServiceCallCenterDataSet();
SvcCallDS = SvcCallAdapter.GetByID(vCallNum);

I get the error: Cannot implicitly convert type ‘bool’ to ‘Erp.BO.ServiceCallCenterDataSet’

Did a trace… the return for ServiceCallCenter.GetByID is a ServiceCallCenterDataSet. I’m quite confused here. Anyone know what’s changed?

As far as I know, calling an Adapter.GetById() method always returns a boolean of whether it is successful or not.

You can try

SvcCallAdapter adapter = new SvcCallAdapter(this.oTrans);
adapter.BOConnect();
bool result = adapter.GetById(vCallNum);
if (result)
    Erp.BO.ServiceCallCenterDataSet SvcCallDS = adapter.SvcCallData;
adapter.Dispose();

I wasn’t able to find the SvcCallAdapter, so I am not entirely sure of its properties.

2 Likes