# Object Reference Not Set

**URL:** <https://www.epiusers.help/t/object-reference-not-set/44958>\
**Category:** Epicor ERP 10\
**Created:** [May 30, 2018, 2:48pm UTC](https://www.epiusers.help/t/object-reference-not-set/44958 "2018-05-30T14:48:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Will79](https://www.epiusers.help/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Will79](https://www.epiusers.help/u/Will79)\
**Post date:** [May 30, 2018, 2:48pm UTC](https://www.epiusers.help/t/object-reference-not-set/44958/1 "2018-05-30T14:48:00Z")

</div>

So, in the MES, when trynig to log out of a job operation, we get the Object Ref Error. I ahve tried recycling/resetting the IIS and it does nothing to help. Ideas?

Application Error

Exception caught in: Epicor.ServiceModel

# Error Detail

Message: Object reference not set to an instance of an object.  
Program: Epicor.ServiceModel.dll  
Method: ShouldRethrowNonRetryableException

# Client Stack Trace

at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)  
at Erp.Proxy.BO.LaborImpl.Update(LaborDataSet ds)  
at Erp.Adapters.LaborAdapter.OnUpdate()  
at Ice.Lib.Framework.EpiBaseAdapter.Update()  
at Erp.UI.App.EndActivityEntry.EndActTransaction.Update()

---

<div class="post-metadata">

**Author:** ![knash](https://www.epiusers.help/user_avatar/www.epiusers.help/knash/32/74179_2.png) [@knash](https://www.epiusers.help/u/knash)\
**Post date:** [May 30, 2018, 2:53pm UTC](https://www.epiusers.help/t/object-reference-not-set/44958/2 "2018-05-30T14:53:59Z")

</div>

Is this a custom MES Screen or BASE?

---

<div class="post-metadata">

**Author:** ![Will79](https://www.epiusers.help/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Will79](https://www.epiusers.help/u/Will79)\
**Post date:** [May 30, 2018, 2:54pm UTC](https://www.epiusers.help/t/object-reference-not-set/44958/3 "2018-05-30T14:54:20Z")

</div>

Base

---

<div class="post-metadata">

**Author:** ![josephmoeller](https://www.epiusers.help/user_avatar/www.epiusers.help/josephmoeller/32/81429_2.png) [@josephmoeller](https://www.epiusers.help/u/josephmoeller)\
**Post date:** [May 30, 2018, 3:44pm UTC](https://www.epiusers.help/t/object-reference-not-set/44958/4 "2018-05-30T15:44:50Z")

</div>

Is this one particular job operation, or all? If one, you might want to check the database to see if there are appropriate associated labor and job records behind the scenes.

---

<div class="post-metadata">

**Author:** ![bordway](https://www.epiusers.help/user_avatar/www.epiusers.help/bordway/32/30753_2.png) [@bordway](https://www.epiusers.help/u/bordway)\
**Post date:** [May 30, 2018, 4:50pm UTC](https://www.epiusers.help/t/object-reference-not-set/44958/5 "2018-05-30T16:50:28Z")

</div>

Have you already tried removing the job from the schedule, then rescheduling that job?

I know it sounds crazy but… it does seem to clear up some issues users have with ending their activities on a job operations.

---

<div class="post-metadata">

**Author:** ![Will79](https://www.epiusers.help/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Will79](https://www.epiusers.help/u/Will79)\
**Post date:** [May 30, 2018, 6:53pm UTC](https://www.epiusers.help/t/object-reference-not-set/44958/6 "2018-05-30T18:53:11Z")

</div>

This is on 5 different jobs, but the same operation.

---

<div class="post-metadata">

**Author:** ![Will79](https://www.epiusers.help/letter_avatar_proxy/v4/letter/w/ea666f/32.png) [@Will79](https://www.epiusers.help/u/Will79)\
**Post date:** [May 30, 2018, 6:53pm UTC](https://www.epiusers.help/t/object-reference-not-set/44958/7 "2018-05-30T18:53:21Z")

</div>

No, but that is worth a try.

---

<div class="post-metadata">

**Author:** ![TerryR](https://www.epiusers.help/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@TerryR](https://www.epiusers.help/u/TerryR)\
**Post date:** [November 21, 2022, 4:50pm UTC](https://www.epiusers.help/t/object-reference-not-set/44958/8 "2022-11-21T16:50:37Z")

</div>

Anyone figure this out? We’re having same issue for 1 specific operation. Error pops up with any user logging to this one operation. Error pops if logged into custom MES, base MES, base Office MES, and handheld menu. Does not occur for other operations. Can’t see anything different on Resource Group, Resource, or Operation screens.

Client error:

```auto
Application Error

Exception caught in: Epicor.ServiceModel

Error Detail 
============
Correlation ID: e695f19b-97e1-4e11-982c-c38173880aaa
Message: Object reference not set to an instance of an object.
Program: Epicor.ServiceModel.dll
Method: ShouldRethrowNonRetryableException

Client Stack Trace 
==================
   at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)
   at Erp.Proxy.BO.LaborImpl.EndActivity(LaborDataSet ds)
   at Erp.Adapters.LaborAdapter.EndActivity()

```

Server error:

```auto
Ice.Common.EpicorServerException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Erp.Services.BO.LaborSvc.EndActivity(LaborTableset& ds) in C:\_releases\ERP\ERP11.1.200.0\Source\Server\Services\BO\Labor\Labor.cs:line 6691
   at Erp.Services.BO.LaborSvcFacade.EndActivity(LaborTableset& ds) in C:\_releases\ERP\ERP11.1.200.0\Source\Server\Services\BO\Labor\LaborSvcFacade.cs:line 1960
   at SyncInvokeEndActivity(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func`2 func) in C:\_releases\ICE\ICE4.1.200.13\Source\Server\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59
   at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func`2 func) in C:\_releases\ICE\ICE4.1.200.13\Source\Server\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 28
   --- End of inner exception stack trace ---

```

Thanks much

---

<div class="post-metadata">

**Author:** ![TerryR](https://www.epiusers.help/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@TerryR](https://www.epiusers.help/u/TerryR)\
**Post date:** [November 21, 2022, 8:21pm UTC](https://www.epiusers.help/t/object-reference-not-set/44958/9 "2022-11-21T20:21:06Z")

</div>

We traced this to moving an employee from one department to another. He had a Resource attached to his Emp ID, that was never used on any labordtl transaction. So after we moved him, and remove the resource group from Employee Maintenance, it deleted the resource. This somehow broke the operation, even though this specific resource was not assigned to it… we’re still looking into exactly why it broke.  
 ![image](https://www.epiusers.help/uploads/default/original/3X/8/d/8dc9d90e630649e9b1f72ecad02ab475faa49132.png)

Update - So issue is that at least Epicor ver 2021.2.13 will allow you to delete a resource even if there are operations scheduled to it (in ResourceTimeUsed table). Fix is to not delete those resources. Rather move them to an eg zzObsolete resource group. This prevents future jobs from scheduling those resources. Then after the current jobs finish, the ResourceTimeUsed table gets cleared out, and those bad resources can be deleted. To speed it up, you can “Remove From Schedule” on all the jobs referencing the bad resource, then reschedule.
