Solved

Generic Argument Error in Acumatica: Resolving 'GenericArguments[0], 'PX.Data.FieldNameParam' Constraint Violation

  • 30 July 2023
  • 8 replies
  • 123 views

Userlevel 3
Badge

Hey All

 

hope everyone is having a great weekend!

 

i’m struggling with this Request i’m trying to make to

GET: /ProjectTransactions,

 

i want to get ProjectTaskID or ProjectID 

 

but when i added it i get this error 

{\"message\":\"An error has occurred.\",\"exceptionMessage\":\"GenericArguments[0], 'PX.Data.FieldNameParam', on 'PX.Data.Current`1[Field]' violates the constraint of type 'Field'.\

 

 

 

 

 

Thanks

icon

Best answer by Django 30 July 2023, 21:18

View original

8 replies

Userlevel 7
Badge +5

I think you have to add the details into a separate entity because it is a child of the project. Similar to how the Details of a Sales Order at set up and queried.

 

Userlevel 3
Badge

@Django Thank you for your reply, this right ?

 

 

Userlevel 7
Badge +5

Looks good.  Then you make the GET call to ProjectTransaction and include $expand=Details to show the detail records and fields in the result set.

Userlevel 3
Badge

@Django it shows new error i tried to call this /ProjectTransactionDetail i guess it a GI and it need PUT instead of GET 

with GET i receive this error 
\"message\":\"An error has occurred.\",\"exceptionMessage\":\"Entity without screen binding cannot be used as top level entity.\",\"exceptionType\":\"PX.Api.ContractBase

With PUT 


    "message": "{\"message\":\"The request is invalid.\",\"modelState\":{\"\":[\"The request body should not be empty.\"]}}"


Thanks

Userlevel 7
Badge +5

You don’t call the child entities directly. Make your GET to ProjectTransaction and add to the URL $expand=Details along with any filtering on the Header entity that you want. This will give you the Summary (Header) record and fields and the detail records and fields related to the ProjectTransaction records that your request asks for.

 

Userlevel 3
Badge

@Django I see it worked! Thank you so much becasue i want to filter using taskID inside details array is that possible 

/ProjectTransaction?$expand=Details


Thanks 

Userlevel 7
Badge +5

It isn’t possible to filter the details in the call. The calling application would have to do that after it receives the result set.

Userlevel 3
Badge

@Django Thank you so much i will check and see

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