Skip to main content
Question

"More than one entity satisfies the condition" Error during uploading attachment

  • August 9, 2024
  • 7 replies
  • 193 views

Forum|alt.badge.img+2

Hi, 

I used such request for uploading attachments to Acumatica for Bills

https://mycloud.acumatica.com/entity/ARTSDocEndpoint/23.200.001/bill/inv/096178/files/105908469_2024-07-29.pdf

It worked for all environments, but suddenly I started received such error 

{"message":"An error has occurred.","exceptionMessage":"More than one entity satisfies the condition.","exceptionType":"PX.Api.ContractBased.MoreThanOneEntitySatisfiesTheConditionException","stackTrace":"   at PX.Api.ContractBased.EntityService.GetImpl(ISystemContract systemContract, String version, String name, EntityImpl entity, PXGraph screenGraph, EntityDescriptor entityDescriptor, CbOperationContext operationContext)\r\n   at PX.Api.ContractBased.EntityService.DetermineEntityDescriptor(ISystemContract systemContract, String version, String name, EntityImpl entity, EntityExportContextBuilder entityExportContextBuilder, EntityDescriptor& entityDescriptor, PXGraph graph, CbOperationContext operationContext, Boolean& isArchived)\r\n   at PX.Api.ContractBased.EntityService.PutFiles(ISystemContract systemContract, String version, String name, EntityImpl entity, File[] files, CbOperationContext operationContext)\r\n   at PX.Api.ContractBased.SystemContracts.V2.Facade.PX.Api.ContractBased.IRestGate.PutFile(EntityImpl entityImpl, String filename, HttpContent body)\r\n   at PX.Api.ContractBased.SystemContracts.V2.RestController.PutFile(String objectName, String ids)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"}

 

7 replies

Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

Hi @Ivan,

Do a GET request for the bill and then use the URL in the files node in the response. For details on it kindly refer, https://help.acumatica.com/(W(7))/Help?ScreenId=ShowWiki&pageid=591def3d-5fe5-42c1-bb35-cfe5b4c77f6f

Feel free to post back if you have any questions.! Good Luck, 


Forum|alt.badge.img+2
  • Author
  • Varsity I
  • August 13, 2024

Hi @Ivan,

Do a GET request for the bill and then use the URL in the files node in the response. For details on it kindly refer, https://help.acumatica.com/(W(7))/Help?ScreenId=ShowWiki&pageid=591def3d-5fe5-42c1-bb35-cfe5b4c77f6f

Feel free to post back if you have any questions.! Good Luck, 

Hi,

I did this, it same thing. With this endpoint it works sometimes and sometimes I receive this error. I tried same request with another endpoint and it worked


RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+4
  • Acumatica Moderator
  • August 13, 2024

@Ivan 

It worked for all environments, but suddenly I started received such error 

Do you know if something changed recently, application update/upgrade. IIS/windows updates, any code changes(have you tried same request in POSTMAN).

If it worked before with same/similar data and API call(code), and suddenly stopped working, this might need further investigation.

Maybe test with postman and share some screenshots


Forum|alt.badge.img+2
  • Author
  • Varsity I
  • August 13, 2024

@Ivan

It worked for all environments, but suddenly I started received such error 

Do you know if something changed recently, application update/upgrade. IIS/windows updates, any code changes(have you tried same request in POSTMAN).

If it worked before with same/similar data and API call(code), and suddenly stopped working, this might need further investigation.

Maybe test with postman and share some screenshots

I do not have any information about update/upgrade. What can I check for investigation ?


RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+4
  • Acumatica Moderator
  • August 13, 2024

@Ivan 

Maybe review following screen

 


Forum|alt.badge.img+2
  • Author
  • Varsity I
  • August 22, 2024

@Ivan

Maybe review following screen

 

Hi

I just find out that there was an update of Acumativa version. Before update everything worked


Forum|alt.badge.img+2
  • Author
  • Varsity I
  • August 22, 2024

I noticed this happens with large documents. Are there any restrictions for file size in Acumatica?