Skip to main content
Solved

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

  • July 30, 2023
  • 8 replies
  • 297 views

Driss
Jr Varsity III
Forum|alt.badge.img

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

Best answer by Django

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.

 

8 replies

Forum|alt.badge.img+7
  • Captain II
  • July 30, 2023

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.

 


Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • July 30, 2023

@Django Thank you for your reply, this right ?

 

 


Forum|alt.badge.img+7
  • Captain II
  • July 30, 2023

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.


Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • July 30, 2023

@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


Forum|alt.badge.img+7
  • Captain II
  • Answer
  • July 30, 2023

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.

 


Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • July 30, 2023

@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 


Forum|alt.badge.img+7
  • Captain II
  • July 30, 2023

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.


Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • July 30, 2023

@Django Thank you so much i will check and see