Solved

Integration using NodeJs

  • 11 August 2022
  • 6 replies
  • 288 views

Hello, I am new to Acumatica, I have been working for a while on a project trying to cross information between Acumatica and other information sources and I am using Node js with an endpoint service to do that, let me show you what my problem is.

I got the items from my request, as shown in the image (number 1), in my request I used the parameter "$expand=Detail" for that reason, I got all the items (number 2) but it takes a lot of time (number 3 ) around 30 seconds, I need to reduce the query time.

Different parameters that I can use are mentioned in the Acumatica notes, one of them is "$filter". I have tried using different ways to filter the query, but to no avail.

The parameters has been send like:

"<Acumatica ERP instance URL>/entity/Integration/18.200.001/Integration?$expand=Detail&$filter=Date gt DateTimeOffset'2022-08-03T00:00:00+00:00'"

 

I tried to test with Postman and it's response was:

{
"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 "
}

 

I don't know what I did wrong, I changed the date parameters (url encode, change date format, add quotes among other things) but it doesn't work.

Thank you for your help and support regarding this issue

icon

Best answer by Cristian 16 August 2022, 22:02

View original

6 replies

Userlevel 4
Badge +2

Hi Cristian,

You might need to encode the URL as specified in the help documentation provided here:

https://help-2021r2.acumatica.com/(W(2))/Help?ScreenId=ShowWiki&pageid=f279ec05-2f71-4376-a76f-d3ed0e0e2556

Hi Kulvir.
I tried to do it in different ways:
 

{{AcumaticaURL}}/entity/Integration/18.200.001/Integration?$expand=Detail&$filter=Date%20ge%20DateTimeOffset'2021-01-01T00%3A00%3A00%2B000'
replacing all special characters
{{AcumaticaURL}}/entity/Integration/18.200.001/Integration?$expand=Detail&$filter=Date ge DateTimeOffset'2021-01-01T00%3A00%3A00%2B000'

replacing special characters on date but without spaces (%20)

 

{{AcumaticaURL}}/entity/Integration/18.200.001/Integration?$expand=Detail&$filter=Date%20gt%20DateTimeOffset'2021-01-01T00:00:00-00'
replacing spaces but without replace special characters

I really appreciate your help.

Thank you​​​​​​​

Userlevel 4
Badge +2

Mimic the example in the help file and be sure the url is case sensitive.

Ex. LastModified gt datetimeoffset’2016-07-15T10%3A31%3A28.402%2B03%3A00’

look at this:

 

"exceptionMessage": "More than one entity satisfies the condition."

 

status: 500 Internal Server Error

Mimic the example in the help file and be sure the url is case sensitive.

Ex. LastModified gt datetimeoffset’2016-07-15T10%3A31%3A28.402%2B03%3A00’

Hello Kulvir.
 

I tried to do that, but it still doesn’t work, Now, I added the date and it shows me the message "More than one entity satisfies the condition", then I removed the date and I send the query again and it doesn't return all the items, it only return the firsts element of the list that fulfill the condition.

Could you help me with this subject please.

Thank you.

Ok, having been searching for a solution, I found this in the documentation:

I'll try to do this not in the detail query but in the Top entity.
Thank you for your help and support

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved