Solved

How to pass custom fields to Acumatica endpoint?

  • 19 October 2023
  • 5 replies
  • 150 views

Userlevel 2
Badge

Hi,

I added the user defied field (UsrFlag) in the POLine table, I've extended the Endpoint to add the custom field. How I can pass the user defied field to the PurchaseOrderDetail class using the Custom property?

 

Thanks,

Ev

icon

Best answer by edsonvelez64 24 October 2023, 20:40

View original

5 replies

Userlevel 5
Badge

@edsonvelez64 - You should be able to see this new field you added (UsrFlag) by just extending the existing Endpoint (Default) to your own named endpoint.  Once this is done you can “Extend Entity” and then click “Populate” to find your POLine field (UsrFlag).  See my screenshot

 

 

Userlevel 7
Badge +10

Hi @edsonvelez64,

This link will also help you to pass custom field to endpoint.

Regards,

Sweta

 

Badge +11

This link will also help you to pass custom field to endpoint

I believe that link is referencing true UDFs and if I'm not mistaken, the OP is calling a custom field a 'user defined field'.

Userlevel 7
Badge +4

@edsonvelez64,

Adding to @StevenRatner points, as the Custom field is in POLine, it would be right to add the custom field to the Details level than the header level. Below is the screenshot of the option you can try,

 

 

After mapping and saving the extended endpoint, you can do a GET request and expand Details to fetch the custom field along the Detail Lines. Feel free to share more details if you have any questions, Good Luck.!  

Userlevel 2
Badge

Hi,

Thanks all. 

I mean how to pass these new fields to the endpoint. But I managed to send them this way.

 

var customFields = new Dictionary<string, CustomField>
{
{ "UsrFlag", new CustomIntField { Value = 0 } }

};

Document.Details.Add(new PurchaseOrderDetail
{
WarehouseID = siteId,
InventoryID = "",
OrderQty = 0m,
Requested = DateTime.Now,
UnitCost = 0m,
UOM = "",
Note = "",
Custom = new Dictionary<string, Dictionary<string, CustomField>> { { "Transactions", customFields } },
OrderType = "RO"
});

 

 

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