Skip to main content
Solved

How to pass custom fields to Acumatica endpoint?

  • October 19, 2023
  • 5 replies
  • 425 views

Forum|alt.badge.img

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

Best answer by edsonvelez64

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"
});

 

 

5 replies

StevenRatner
Varsity I
Forum|alt.badge.img
  • Varsity I
  • October 19, 2023

@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

 

 


Forum|alt.badge.img+9
  • Semi-Pro III
  • October 20, 2023

Hi @edsonvelez64,

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

Regards,

Sweta

 


darylbowman
Captain II
Forum|alt.badge.img+15

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


Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

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


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Answer
  • October 24, 2023

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"
});