Engineering Workbench Clear All Not Working in Customization

I am attempting to replicate the Engineering Workbench Clear All method in a c# customization but it is blowing an error on me:

Business Layer Exception

Record not available.

Exception caught in: Epicor.ServiceModel

Error Detail

Description: Record not available.
Program: Erp.Services.BO.EngWorkBench.dll
Method: ClearAll
Line Number: 8873
Column Number: 5
Table: ECORev

Client Stack Trace

at Epicor.ServiceModel.Channels.ImplBase1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets) at Erp.Proxy.BO.EngWorkBenchImpl.ClearAll(String ipGroupID, String ipPartNum, String ipRevisionNum, String ipAltMethod, Nullable1 ipAsOfDate, Boolean ipCompleteTree, Boolean ipReturn, Boolean ipGetDatasetForTree, Boolean ipUseMethodForParts)
at Erp.Adapters.EngWorkBenchAdapter.ClearAll(String ipGroupID, String ipPartNum, String ipRevisionNum, String ipAltMethod, DateTime ipAsOfDate, Boolean ipCompleteTree, Boolean ipReturn, Boolean ipGetDatasetForTree, Boolean ipUseMethodForParts)

When I performed a trace on the action that I do manually, I get the following information/parameters from the trace:

tracePacket
businessObjectErp.Proxy.BO.EngWorkBenchImplbusinessObject
methodNameClearAllmethodName
appServerUrinet.tcp:epicor10testERP102300TestappServerUri
returnTypeErp.Tablesets.EngWorkBenchTablesetreturnType
localTime6132023 18:29:03:2865526 PMlocalTime
threadID1threadID
executionTime total=“170” roundTrip=“168” channel=“0” bpm=“0” other=“2”
retries0retries
parameters
parameter name=“ipGroupID” type=“System.String”![CDATA[Autoclear]]parameter
parameter name=“ipPartNum” type=“System.String”![CDATA[SRE-3050]]parameter
parameter name=“ipRevisionNum” type=“System.String”![CDATA[1]]parameter
parameter name=“ipAltMethod” type=“System.String”![CDATA]parameter
parameter name=“ipAsOfDate” type=“System.DateTime”![CDATA[6132023 12:00:00 AM]]parameter
parameter name=“ipCompleteTree” type=“System.Boolean”![CDATA[False]]parameter
parameter name=“ipReturn” type=“System.Boolean”![CDATA[True]]parameter
parameter name=“ipGetDatasetForTree” type=“System.Boolean”![CDATA[True]]parameter
parameter name=“ipUseMethodForParts” type=“System.Boolean”![CDATA[False]]parameter
parameters
tracePacket

And here is the code I am utilizing for it (partNum = “SRE-3050”, revNum = “1”)

		EngWorkBenchAdapter adapter = new EngWorkBenchAdapter(oTrans);
		adapter.BOConnect();	
		Boolean success = adapter.ClearAll("Autoclear", partNum, revNum, null, DateTime.Now, false, true, true, false);

I believe the part rev is in the same state as it is in the workbench (unapproved, checked out to “Autoclear”). I need to perform this action in the customization. Anything I could try differently?

Pass an empty string for the AltMethod instead of a null?

I did try that, and same results.

Looking through my own implementations, I’m doing pretty much the same as you. Some of the boolean fields differ depending on whether or not I need the DS back, and I’ve used both the rev effectivedate and DateTime.Today. It all works as expected.

  1. Run the exact command through the BL Tester and see what it does.
  2. Run your customization through a debug session in VS and see if it gives you any clues.
1 Like

Thanks so much for pointing me to the BL Tester, I hadn’t used it before. It was on our server but it looks like it wasn’t ever configured. I found a post https://www.epiusers.help/t/setting-up-the-bl-tester/54385 that showed me how to set it up real quick and I have to say, I wish I had found this sooner, it is super useful. Long story made short - with BL Tester, I was able to play with a variety of settings until I found the right combination that worked for our environment.

I didn’t get to debugging it in Visual Studio but that was also a great suggestion. Thanks again for saving the day!

1 Like

FYI, there’s also the REST Swagger page. I think that’s available on 10.2.300 in v1 form.

:beers: