Get Custom Data with Product Not from Item Table

For example you need to retrieve the 'Comments' custom field
from NAV:

Step 1: You have to extend the XML containing
product information which is returned from NAV. You can do it
by adding the following code in the 'AddProductXMLDefaultFields'
function in the 'SC - Catalog Helper' codeunit:

XMLFunctions.AddFieldElement(ResultNode,' Comments ', Comments);

In above code the second parameter contains the name of the
field element you want to add to the XML and the third parameter
should contain the value to pass from NAV.

Step 2: The field can be accessible through the
'Fields' collection by key. You can use the following code to get
the field value:

var comments = product["Comments"];

You can also save value in another place by overriding the
'SaveProduct' product function of the class inherited from the
'ProductImportTask' class and adding the code to the save
value.

Product Versions

Links

Sana Commerce does not accept any liability for the content of this website, or for the consequences of any actions taken on the basis of the information provided. The information below should be interpreted as an example. No rights can be derived from this information.
Sana Commerce – the integrated e-Commerce solution for Microsoft Dynamics NAV & AX