Skip to main content
Solved

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

  • Jul 11, 2023 12:45 PM UTC
  • 7 replies
  • 248 views
  • Translate All

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.

View original

7 replies

jinin
Pro I
Forum|alt.badge.img+12
  • Pro I
  • Jul 11, 2023 1:19 PM UTC

Hi @ashrivastava42 ,

Can you please share the request URL?

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

 

Translate

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

Translate

jinin
Pro I
Forum|alt.badge.img+12
  • Pro I
  • Jul 11, 2023 2:31 PM UTC

Hi @ashrivastava42 ,

The above URL is looking good.

I hope that you extend the default like below.

 

Translate

Forum|alt.badge.img

Hello @jinin,

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

Translate

jinin
Pro I
Forum|alt.badge.img+12
  • Pro I
  • Jul 12, 2023 6:08 AM UTC

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?

Translate

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.

Translate

Zoltan Febert
Jr Varsity I
Forum|alt.badge.img+4
  • Jr Varsity I
  • Answer
  • Jul 12, 2023 2:20 PM UTC

@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.

Translate