0
votes

I customized screen of Acumatica by new text fields in customer screen below:

enter image description here

After I want get data from custom field in below code but it's not working:

 foreach (CustomStringField customField in customerData.MainContact.Address.CustomFields)
2
What do you mean by "not working"? What happens? What did you expect instead? Any errors? Also, please format your code (indent 4 spaces or use the {} button) and include the image right here instead of linking to it, so that everything is in one place and easy to understand. - Robert
What versionsof acumatica and webservice contract did you use? If it is 6.00.001 version of webservice contract (available in acumatica 6.0+) You should explicitly say what custom fields do you want to get. - Kirill Bestemyanov
I get null from custom field but the custom field in Acumatica ERP, it have data. I don't know clearly about how to access custom field in Acumatica 6.0 +. Thank - vannak

2 Answers

0
votes

You can go to Web Service Endpoint screen to create new endpoint by click extend endpoint from default endpoint. You need to find Endpoint > Customer then click on fields tab and click populate(click EXTENDENTITY to Enable). Then search for Main Address and you will see your custom field.

0
votes

If you don't want to modify the existing endpoint but just get "Custom" fields then you can append an additional value to the URL

http://help.myob.com.au/advanced/whitepapers/MYOB%20Advanced%20-%20REST%20API.pdf - MYOB Advanced uses the same accumatica system

Search for $custom Parameter - in the parameter string you would attach $custom=ItemSettings.PostClassID to get one of the custom fields.

You can get a list of Custom fields using the getSchema method

http://accumatica/entity/Default/6.00.001/StockItem/$adHocSchema

http://accumatica/entity/Default/6.00.001/StockItem?$custom=ItemSettings.PostClassID