Skip to main content
Solved

Error: violates the constraint of type 'Field', when Extend endpoint

  • July 11, 2023
  • 7 replies
  • 193 views

Forum|alt.badge.img

I extent and point from default endpoint (version 22.200.001) of acumatica and I add new fields in the stockitem, then call the stockitem by postman to view warehousedetails(Qty on hand), getting exception message ‘GenericArguments[0], 'PX.Data.FieldNameParam', on 'PX.Data.Optional`1[Field]' violates the constraint of type 'Field'.’, but I m trying same with the default endpoint it working expected, please let me know what I did wrong by mistake. or how can I resolve it

 

Extended endpoint for Stockitem 

 

Best answer by Zoltan Febert

@ashrivastava42 You can add your old and new endpoint to a customization project. If you go to File / Edit Project XML in the customization project editor, you can see the “source code” of the endpoints, and you can find out what the difference is between them.

7 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • July 11, 2023

Hi @ashrivastava42 ,

Can you please share the request URL?

I just added the Tracking method and tried it, its works for me.
 

 


Forum|alt.badge.img

Thanks for quick reply

URL:

{{URL}}/entity/ewsfendpoint/22.200.001/StockItem?$filter=InventoryID eq 'AACOMPUT01'&$select=InventoryID,Description,WarehouseDetails/WarehouseID,WarehouseDetails/QtyOnHand,ItemClass,BaseUOM&$expand=WarehouseDetails


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • July 11, 2023

Hi @ashrivastava42 ,

The above URL is looking good.

I hope that you extend the default like below.

 


Forum|alt.badge.img

Hello @jinin,

Yes, it’s right and I believe this is correct way.


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • July 12, 2023

Hi @ashrivastava42 ,

Yes, that is the correct way to extend the endpoint. Could you please create a new extend endpoint and try the same again?


Forum|alt.badge.img

Hello @jinin,

Yes, I did same and it is working, but in my current extended endpoint I have added so many entity to expose for integration, hear I am expecting to resolve the issue, otherwise I need to rework again in new endpoint to create same entity.


Zoltan Febert
Jr Varsity I
Forum|alt.badge.img+3
  • Jr Varsity I
  • Answer
  • July 12, 2023

@ashrivastava42 You can add your old and new endpoint to a customization project. If you go to File / Edit Project XML in the customization project editor, you can see the “source code” of the endpoints, and you can find out what the difference is between them.