Skip to main content
Solved

Integration using NodeJs


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

Best answer by Cristian

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

View original
Did this topic help you find an answer to your question?

6 replies

Kulvir Kaila
Jr Varsity I
Forum|alt.badge.img+1
  • Jr Varsity I
  • 61 replies
  • August 11, 2022

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


  • Author
  • Freshman II
  • 4 replies
  • August 11, 2022

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​​​​​​​


Kulvir Kaila
Jr Varsity I
Forum|alt.badge.img+1
  • Jr Varsity I
  • 61 replies
  • August 11, 2022

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’


  • Author
  • Freshman II
  • 4 replies
  • August 11, 2022

look at this:

 

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

 

status: 500 Internal Server Error


  • Author
  • Freshman II
  • 4 replies
  • August 15, 2022
Kulvir Kaila wrote:

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.


  • Author
  • Freshman II
  • 4 replies
  • Answer
  • August 16, 2022

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings