How toDeveloper Guide

Developer Guide

Sana Commerce 9.0
Your connector

Get a Custom Field from the Item Table in NAV

To get a custom field from Product table in NAV you can add the field name to the 'EntityFields' collection of product load options or product list load options passed to functions which fetch the data from NAV.
For example you need to retrieve the 'Producer' custom field from NAV. In the 'Item' table you have custom column with the 'Producer' name.
IProductLoadOptions options = ObjectManager.GetInstance<IProductLoadOptions>();
options.EntityFields = new List<string>() { "Producer" };
var product = CommerceFramework.Catalog.GetProduct(id, options);
The field can be accessible through the 'Fields' collection by key. You can use the following code to get the field value:
var producer = product["Producer"];
How toDeveloper Guide