REST API troubleshooting ChangeJobHeadJobEngineered

I’ve had success using the new REST API, but I am running into a problem with the ChangeJobHeadJobEngineered custom method. What methods of debugging are available besides the REST return message and the AppServer error log? Does anyone have insight on calling this custom method?

I’m confident that the dataset (ds) parameter being passed is correct. It matches what I see from the dataset in a trace I captured and the swagger API example. When calling this custom method the API responds with the general error message.

Sorry! Something went wrong. Please contact your system administrator. 

The AppServer error message is…

Business Logic Error
Business Layer Exception
BLException
Description: JobHead has not changed.
Program: Erp.Services.BO.JobEntry.dll
Method: ChangeJobHeadJobEngineered
Line Number: 9200
Column Number: 17
Table: JobHead
Server Trace Stack: at Erp.Services.BO.JobEntrySvc.ChangeJobHeadJobEngineered(JobEntryTableset& ds) in C:_Releases\ERP\UD10.1.500.15\Source\Server\Services\BO\JobEntry\JobEntry.cs:line 9200
at Erp.Services.BO.JobEntrySvcFacade.ChangeJobHeadJobEngineered(JobEntryTableset& ds) in C:_Releases\ERP\UD10.1.500.15\Source\Server\Services\BO\JobEntry\JobEntrySvcFacade.cs:line 565
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Ice.Hosting.RestApi.OperationInvokeHelper.<>c__DisplayClass25_0.b__0(Object obj) in C:_Releases\ICE\3.1.500.15\Source\Framework\Epicor.Ice\Hosting\ServiceCaller\OperationInvokeHelper.cs:line 285
at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func2 func) in C:\_Releases\ICE\3.1.500.15\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59 at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func2 func) in C:_Releases\ICE\3.1.500.15\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 28
at Ice.Hosting.RestApi.OperationInvokeHelper.CallInvoker(IceDataContext dataContext, Type svcType, MethodInfo mi, Object[] inputs) in C:_Releases\ICE\3.1.500.15\Source\Framework\Epicor.Ice\Hosting\ServiceCaller\OperationInvokeHelper.cs:line 284
at Ice.Hosting.RestApi.OperationInvokeHelper.MakeServiceCall(IceDataContext dataContext, Type svcType, MethodInfo mi, Object[] parameters) in C:_Releases\ICE\3.1.500.15\Source\Framework\Epicor.Ice\Hosting\ServiceCaller\OperationInvokeHelper.cs:line 242
at Epicor.RESTApi.DataSources.IceServiceCaller.CallCustomMethod(TypeMapping typeMapping, ContextInfo context, String methodName, Object inputObject) in c:_Releases\ICE\3.1.500\Current\Source\Framework\Epicor.RESTApi\DataSources\IceServiceCaller.cs:line 244
at Epicor.RESTApi.Controllers.CustomActionController.CustomMethod(Object input) in c:_Releases\ICE\3.1.500\Current\Source\Framework\Epicor.RESTApi\Controllers\CustomActionController.cs:line 25
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsyncCore(HttpActionContext actionContext, CancellationToken cancellationToken)
at System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsync(HttpActionContext actionContext, CancellationToken cancellationToken)
at System.Web.Http.Controllers.ActionFilterResult.b__0(ActionInvoker innerInvoker)
at System.Web.Http.Controllers.ActionFilterResult.<>c__DisplayClass101.<InvokeActionWithActionFilters>b__f() at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.Filters.ActionFilterAttribute.CallOnActionExecutedAsync(HttpActionContext actionContext, CancellationToken cancellationToken, Func1 continuation) at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.Filters.ActionFilterAttribute.ExecuteActionFilterAsyncCore(HttpActionContext actionContext, CancellationToken cancellationToken, Func1 continuation) at System.Web.Http.Filters.ActionFilterAttribute.System.Web.Http.Filters.IActionFilter.ExecuteActionFilterAsync(HttpActionContext actionContext, CancellationToken cancellationToken, Func1 continuation)
at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at System.Web.Http.Controllers.ActionFilterResult.ExecuteAsync(CancellationToken cancellationToken) at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.Filters.AuthorizationFilterAttribute.ExecuteAuthorizationFilterAsyncCore(HttpActionContext actionContext, CancellationToken cancellationToken, Func1 continuation) at System.Web.Http.Filters.AuthorizationFilterAttribute.System.Web.Http.Filters.IAuthorizationFilter.ExecuteAuthorizationFilterAsync(HttpActionContext actionContext, CancellationToken cancellationToken, Func1 continuation)
at System.Web.Http.Controllers.AuthorizationFilterResult.ExecuteAsync(CancellationToken cancellationToken)
at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.HttpServer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.Owin.HttpMessageHandlerAdapter.d__0.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.Owin.HttpMessageHandlerAdapter.InvokeCore(IOwinContext context, IOwinRequest owinRequest, IOwinResponse owinResponse)
at Epicor.RESTApi.ConfigureStartup.<>c__DisplayClass3_0.b__0(IOwinContext context, Func1 next) in c:\_Releases\ICE\3.1.500\Current\Source\Framework\Epicor.RESTApi\Startup.cs:line 140 at Microsoft.Owin.Mapping.MapWhenMiddleware.<Invoke>d__0.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.Owin.Mapping.MapWhenMiddleware.Invoke(IDictionary2 environment)
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.d__5.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.RunApp(Func2 entryPoint, IDictionary2 environment, TaskCompletionSource`1 tcs, StageAsyncResult result)
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.BeginEvent(Object sender, EventArgs e, AsyncCallback cb, Object extradata)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

That particular error means that you didn’t modify (or told epicor) the JobHead
Try setting the RowMod=“U” and making the call again.

1 Like

That works. Thanks Jose.

It’s interesting that the trace log from the Epicor client doesn’t have RowMod set to “U” in the parameters passed to ChangeJobHeadJobEngineered, it’s simply blank.

Trace is a great tool but it isn’t perfect :grin:

1 Like

Good to know.

So after calling this method I’m getting an exception error when calling Update method.

 Description: Update not allowed, Engineered and Prevent Changes.

Seem similar to this thread that you (Jose) started.

Here’s the AppServer error trace…

Business Logic Error
Business Layer Exception
BLException
Description: Update not allowed, Engineered and Prevent Changes.
Program: Erp.Services.BO.JobEntry.dll
Method: valPreventChange
Line Number: 5960
Column Number: 29
Table: JobAsmbl
Server Trace Stack: at Erp.Services.BO.JobEntrySvc.valPreventChange() in C:_Releases\ERP\UD10.1.500.15\Source\Server\Services\BO\JobEntry\JobEntry.cs:line 5960
at Erp.Services.BO.JobEntrySvc.BeforeUpdate() in C:_Releases\ERP\UD10.1.500.15\Source\Server\Services\BO\JobEntry\JobEntry.cs:line 5971
at Erp.Services.BO.JobEntrySvc.OnTablesetEvent(DatasetEventType type) in C:_Releases\ERP\UD10.1.500.15\Source\Server\Services\BO\JobEntry\JobEntry.Designer.cs:line 619
at Ice.Services.Trace.TablesetProfilingCollector.DoTablesetEventTrace(String tablesetName, String methodName, Action action) in C:_Releases\ICE\3.1.500.15\Source\Framework\Epicor.Ice\Services\TablesetProfilingCollector.cs:line 200
at Ice.TablesetBound3.InnerUpdate(IceDataContext dataContext, TFullTableset tableset) in C:\_Releases\ICE\3.1.500.15\Source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 794 at Erp.Services.BO.JobEntrySvc.Update(JobEntryTableset& ds) in C:\_Releases\ERP\UD10.1.500.15\Source\Server\Services\BO\JobEntry\JobEntry.Designer.cs:line 7392 at Erp.Services.BO.JobEntrySvcFacade.Update(JobEntryTableset& ds) in C:\_Releases\ERP\UD10.1.500.15\Source\Server\Services\BO\JobEntry\JobEntrySvcFacade.cs:line 4043 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Ice.Hosting.RestApi.OperationInvokeHelper.<>c__DisplayClass25_0.<CallInvoker>b__0(Object obj) in C:\_Releases\ICE\3.1.500.15\Source\Framework\Epicor.Ice\Hosting\ServiceCaller\OperationInvokeHelper.cs:line 285 at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func2 func) in C:_Releases\ICE\3.1.500.15\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59
at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func2 func) in C:\_Releases\ICE\3.1.500.15\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 28 at Ice.Hosting.RestApi.OperationInvokeHelper.CallInvoker(IceDataContext dataContext, Type svcType, MethodInfo mi, Object[] inputs) in C:\_Releases\ICE\3.1.500.15\Source\Framework\Epicor.Ice\Hosting\ServiceCaller\OperationInvokeHelper.cs:line 284 at Ice.Hosting.RestApi.OperationInvokeHelper.MakeServiceCall(IceDataContext dataContext, Type svcType, MethodInfo mi, Object[] parameters) in C:\_Releases\ICE\3.1.500.15\Source\Framework\Epicor.Ice\Hosting\ServiceCaller\OperationInvokeHelper.cs:line 242 at Epicor.RESTApi.DataSources.IceServiceCaller.CallCustomMethod(TypeMapping typeMapping, ContextInfo context, String methodName, Object inputObject) in c:\_Releases\ICE\3.1.500\Current\Source\Framework\Epicor.RESTApi\DataSources\IceServiceCaller.cs:line 244 at Epicor.RESTApi.Controllers.CustomActionController.CustomMethod(Object input) in c:\_Releases\ICE\3.1.500\Current\Source\Framework\Epicor.RESTApi\Controllers\CustomActionController.cs:line 25 at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken)
at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsyncCore(HttpActionContext actionContext, CancellationToken cancellationToken) at System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsync(HttpActionContext actionContext, CancellationToken cancellationToken) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>b__0(ActionInvoker innerInvoker) at System.Web.Http.Controllers.ActionFilterResult.<>c__DisplayClass101.b__f()
at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at System.Web.Http.Filters.ActionFilterAttribute.CallOnActionExecutedAsync(HttpActionContext actionContext, CancellationToken cancellationToken, Func1 continuation)
at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at System.Web.Http.Filters.ActionFilterAttribute.ExecuteActionFilterAsyncCore(HttpActionContext actionContext, CancellationToken cancellationToken, Func1 continuation)
at System.Web.Http.Filters.ActionFilterAttribute.System.Web.Http.Filters.IActionFilter.ExecuteActionFilterAsync(HttpActionContext actionContext, CancellationToken cancellationToken, Func1 continuation) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.Controllers.ActionFilterResult.ExecuteAsync(CancellationToken cancellationToken)
at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at System.Web.Http.Filters.AuthorizationFilterAttribute.ExecuteAuthorizationFilterAsyncCore(HttpActionContext actionContext, CancellationToken cancellationToken, Func1 continuation)
at System.Web.Http.Filters.AuthorizationFilterAttribute.System.Web.Http.Filters.IAuthorizationFilter.ExecuteAuthorizationFilterAsync(HttpActionContext actionContext, CancellationToken cancellationToken, Func1 continuation) at System.Web.Http.Controllers.AuthorizationFilterResult.ExecuteAsync(CancellationToken cancellationToken) at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken) at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.HttpServer.d__0.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at System.Web.Http.HttpServer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Web.Http.Owin.HttpMessageHandlerAdapter.<InvokeCore>d__0.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at System.Web.Http.Owin.HttpMessageHandlerAdapter.InvokeCore(IOwinContext context, IOwinRequest owinRequest, IOwinResponse owinResponse) at Epicor.RESTApi.ConfigureStartup.<>c__DisplayClass3_0.<ConfigureIceAuth>b__0(IOwinContext context, Func1 next) in c:_Releases\ICE\3.1.500\Current\Source\Framework\Epicor.RESTApi\Startup.cs:line 140
at Microsoft.Owin.Mapping.MapWhenMiddleware.d__0.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.Owin.Mapping.MapWhenMiddleware.Invoke(IDictionary2 environment) at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.<RunApp>d__5.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.RunApp(Func2 entryPoint, IDictionary2 environment, TaskCompletionSource1 tcs, StageAsyncResult result)
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.BeginEvent(Object sender, EventArgs e, AsyncCallback cb, Object extradata)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

Unchecking “Prevent Changes” in Company Configuration allowed this Update call to work. But, this is not really a solution because we need this field checked for our business processes. Why does this flag prevent setting JobEngineered to false via a call to Update? Seems self defeating…

Yeah did you set the actual.field to false in your call? Sometimes even though you call ChanStatus you need to set the flag in the dataset too

Yes I set the field in the dataset to false before the call to ChangeJobHeadJobEngineered. What and where is the ChanStatus call in the REST API?

I’m wondering what purpose the ChangeJobHeadJobEngineered Method serves other than to set the JobReleased flag in the dataset to false. It doesn’t update the database record until Update is called and Update doesn’t work if Prevent Changes flag in Company Configuration is set.

After unchecking the Prevent Changes flag in Company Configuration I was able to call skip calling ChangeJobHeadJobEngineered and just call Update.

I’m getting this same issue in Epicor 10.2.400.12 through the API. I can’t release/unrelease/unengineer jobs over the API because of the same error. The same calls from the client side work fine. Did anybody find a workaround other than toggling the flag in company maintance?

I don’t know why I didn’t do it sooner (as this is exactly what the Ext methods are for) but I got around the Update issue by using the UpdateExt and just sending in the key fields and the fields I wanted to change.

FWIW @Ben_Bowtell the reason for that message is because you are missing the Before Image data

Thanks @josecgomez.

By missing do you mean the API calls aren’t able to replicate how the BOs sometimes expect the dataset? Or could I have solved it by sending the original JobHead row in with no RowMod and the updated JobHead row with RowMod = U in the same dataset? Similar to how the tt tables work in bpms?

I’ve found a couple of other calls in my travels that don’t seem behave correctly using the API where the Epicor client signals changes to data using the DataRow rowstate rather than the value of RowMod.

Yeah you should be able to solve it by sending both the Updated and the NotUpdated row. (though haven’t tested it in REST)
But that does work on the BPM / UI side.

I’ve just had a quick play and not been able to get it working.

I’ve duplicated the row from a GetByID and changed JobReleased to true, ChangeDescription to ‘Released’ and RowMod to ‘U’ and sent both rows back in but still get ‘Update not allowed, Engineered and Prevent Changes.’.

I’ve not bothered support with API queries before, will there be any benefit in sending this in?

Just like the online form, you cannot make some changes to a job until to Un-Engineer it. Unless of course, you allow it in your Company Settings…which is appears that you done. This is regular Epicor and not a REST issue.

You’re right but I’m trying to make an allowed change in releasing it. It just seems the Update API call is too rigid. The same calls in the Epicor client work.

I doubt it.

1 Like

Really? You can use Job Entry to make changes without un-engineering the job? They should be using the same underlying business objects.

For what it’s worth, this is a company setting you can turn off if desired.