Business Central codeunit mappings

The following article contains an overview of how Business Central data is mapped to Dynamicweb in the Business Central plug-in unit. The overview is divided into sections for each relevant table in the Dynamicweb database. The specific data fields of Business Central are marked in bold in the tables below. 

Each section below shows a Dynamicweb entity (e.g. EcomProducts) and a list of the Business Central entities relevant for the entity. The mapping tables show a Dynamicweb field and it's corresponding data source. The source may be a direct mapping with a Business Central data field, a simple inputted string or a calculated variable. 

Customers:

Dynamicweb destination field

Source/value

AccessUserGroupName

“Customers”

AccessGroupName

“Customers”

Salespersons:

Dynamicweb destination field Source/value

AccessUserGroupName

“Sales”

AccessGroupName

“Sales”

AccesUserGroupName: Customers

Imports data from the following Business Central tables:

  • Table 18 Customer
  • Table 5050 Contact
  • Table 5054 Contact Business Relation (ContactBusiness)
  • table 98 "General Ledger Setup" (glsetup)

 

Dynamicweb destination field Source/Value

AccessUserUserName

Contact.”E-Mail”

AccessUserExternalID

Contact.”No.”

AccessUserCustomerNumber

“ContactBusiness.”No.”

AccessUserName

Contact.”Name”

AccessUserEmail

Contact.”Email”

AccessUserPhone

Customer.”Phone No.”

AccessUserFax

Customer.”Fax No.”

AccessUserAddress

Customer.”Address”

AccessUserAddress2

Customer.”Address 2”

AccessUserZip

Customer.”Post Code”

AccessUserCity 

Customer.”City”

AccessUserCountry

Customer.”Country/Region Code”

AccessUserCountryCode

Customer.”Country/Region Code”

AccessUserAddressTitle

“Company address”

AccessUserCompany

Contact.”Company Name”

AccessUserCurrencyCharacter

Customer.”Currency Code” or glsetup.”LCY Code”

AccessUserActive 

“true”

AccessUserWeb

Contact.”Home Page”

AccessUserGroups

“Customers”

 

 AccessUserGroupName: Sales

Imports data from the following Business Central tables:

  • Table 13 “Salesperson/Purchaser” (SalesPerson)

AccessUserUserName

SalesPerson.”E-Mail”

AccessUserExternalID

SalesPerson.”Code”

AccessUserCustomerNumber

SalesPerson.”Code”

AccessUserName

SalesPerson.”Name

AccessUserEmail

SalesPerson.”Email”

AccessUserPhone

SalesPerson.”Phone No.”

AccessUserFax

””

AccessUserAddress

””

AccessUserAddress2

””

AccessUserZip

””

AccessUserCity 

””

AccessUserCountry

””

AccessUserCountryCode

””

AccessUserAddressTitle

“”

AccessUserCompany

””

AccessUserCurrencyCharacter

””

AccessUserActive 

“true”

AccessUserWeb

””

AccessUserGroups

“Sales”

Imports data from the following Business Central tables:

  • Table 18 customer
  • Table 5050 Contact
  • Table 13 “Salesperson/Purchaser” (Salesperson)
  • Table 5054 Contact Business Relation

AccessUserSecondaryRelationId

SalesPerson.”Code”

AccessUserSecondaryRelationSecondaryUserId

Contact.”No.” or Customer.”No.”

Imports data from the following Business Central tables:

  • Table 222 “Ship-to Address” (addresses)
  • table 5051 "Contact Alt. Address"
  • table 5050 Contact
  • table 5054 "Contact Business Relation" (ContactBusiness)
  • table 18 Customer

Contact address:

If Contact.”Company Name” = Customer.Name:

Dynamicweb destination field

Source 

AccessUserAddressUserID

Contact.”No.”

AccessUserAddressType

“1”

AccessUserAddressCallName

“Contact Address”

AccessUserAddressCompany

Contact.”Company Name”

AccessUserAddressName

“Contact Address”

AccessUserAddressAddress

Contact.”Address”

AccessUserAddressAddress2

Contact.”Address 2”

AccessUserAddressZip

Contact.”Post Code”

AccessUserAddressCity

Contact.”City”

AccessUserAddressCountry

Contact."Country/Region Code"

AccessUserAddressCell

Contact.”Mobile Phone No.”

AccessUserAddressFax

Contact.”Fax No.”

AccessUserAddressEmail

Contact.”E-mail”

AccessUserAddressCustomerNumber

ContactBusiness.”No.”

AccessUserAddressUID

Contact.”No.” + “_ContactAddress”

AccessUserAddressState

Contact."Country/Region Code"

AccessUserAddressPhoneBusiness

Contact."Phone No."

AccessUserAddressCountryCode

Contact."Country/Region Code"

AccessUserAddressDefaultAddressCustomFields

“False”

 

Contact alt address:

Dynamicweb destination field

Source 

AccessUserAddressUserID

ContactAltAddress.”No.”

AccessUserAddressType

“1”

AccessUserAddressCallName

ContactAltAddress.”Code”

AccessUserAddressCompany

Contact.”Company Name”

AccessUserAddressName

ContactAltAddress.”Code”

AccessUserAddressAddress

ContactAltAddress.”Address”

AccessUserAddressAddress2

ContactAltAddress.”Address2”

AccessUserAddressZip

ContactAltAddress.”Post Code”

AccessUserAddressCity

ContactAltAddress.”City”

AccessUserAddressCountry

ContactAltAddress."Country/Region Code"

AccessUserAddressCell

ContactAltAddress.”Mobile Phone No.”

AccessUserAddressFax

ContactAltAddress.”Fax No.”

AccessUserAddressEmail

ContactAltAddress.”E-mail”

AccessUserAddressCustomerNumber

ContactBusiness.”No.”

AccessUserAddressUID

ContactAltAddress.”Contact No.” + “_” + ContactAltAddress.”Code”

AccessUserAddressState

ContactAltAddress."Country/Region Code"

AccessUserAddressPhoneBusiness

ContactAltAddress."Phone No."

AccessUserAddressCountryCode

ContactAltAddress."Country/Region Code"

AccessUserAddressDefaultAddressCustomFields

“False”

 

Ship-to addresses:

Dynamicweb destination field

Source 

AccessUserAddressUserId

Contact.”No.” 

AccessUserAddressCompany

Contact.”Company Name”

AccessUserAddressCustomerNumber

ContactBusiness.”No.”

AccessUserAddressUID

Customer.”No. + “_” + Adresses.”Code”

Imports data from the following Business Central tables:

  • Table 9 Country/Region

Dynamicweb destination field

Source 

CountryCode2

Country/Region.”Code”

CountryCultureInfo

Country/Region.”Code”

Imports data from the following Business Central tables:

  • Table 9 Country/Region

Dynamicweb destination field

Source 

CountryTextCode2

Country/Region.”Code”

CountryTextLanguageId

DefaultLanguageId (parsed parameter)

CountryTextName

Country/Region.”Name”

Imports data from the following Business Central tables:

  • Table 4 Currency
  • Table 98 General Ledger Setup

Dynamicweb destination field

Source 

CurrencyCode

Currency.”Code”

CurrencyName

Currency.”Description”

CurrencyLanguageID

Method: GetUserLanguageCode() from codeunit “Language”

CurrencyRate

Calculated exchange rate

IsLCY

Evaluates if Currency.”Code” is equal toGeneral ledger LCY code (true/false)

 

If general ledger currency does not exist in “Currency” table:

Dynamicweb destination field

Source 

CurrencyCode

glsetup.”LCY Code”

CurrencyName

“Local”

CurrencyLanguageID

Method: GetUserLanguageCode() from codeunit “Language”

CurrencyRate

100

IsLCY

True

Imports data from the following Business Central tables:

  • Table 8 Languages

Dynamicweb destination field

Source 

LanguageID

Languages.”Code”

LanguageCode2

Languages.”Code”

LanguageName

Languages.”Name”

Imports data from the following Business Central tables:

  • Table 23 Vendor

Dynamicweb destination field

Source 

ManufacturerID

Vendor.”No.”

ManufacturerName

Vendor.”Name”

ManufacturerAddress

Vendor.”Address”

ManufacturerZipCode

Vendor.”Post Code”

ManufacturerCity

Vendor.”City”

ManufacturerCountry

Vendor.”Country/Region Code”

ManufacturerPhone

Vendor.”Phone No.”

ManufacturerFax

Vendor.”Fax No.”

ManufacturerEmail

Vendor.”E-Mail”

ManufacturerWeb

Vendor.”Home Page”

Imports data from the following Business Central tables:

  • Table 14 Location

Dynamicweb destination field

Source 

StockLocationId

Sets ID as Last ID + 1

StockLocationName

Location.”Code”

StockLocationDescription

If not empty: Location.”Name” else: Location.”Code”

StockLocationLangaugeId

DefaultLanguageId (parsed param)

StockLocationGroupId

Sets ID as Last ID + 1

Imports data from the following Business Central tables:

  • Table 27 item

Dynamicweb destination field

Source 

StockUnitProductId

Item.”No.”

StockUnitVariantId

‘’

StockUnitId

“Unit_” + item. “Base Unit Of Measure”

StockUnitQuantity

Item.“Inventory”

StockUnitStockLocationId

LocationId (last ID + 1)

Imports data from the following Business Central tables:

  • Table 27 Item
  • Table 32 “Item Ledger Entry”
  • table 5401 "Item Variant"
  • table 30 "Item Translation"
  • table 7501 "Item Attribute Value"
  • table 7505 "Item Attribute Value Mapping"
  • table 4 Currency

Dynamicweb destination field

Source 

ProductID

item.”No.”

ProductVariantID

itemvariants.”Code” or “” if variant is empty.  

ProductNumber

item.”No.”

ProductStock

If variant: itemLedgerEntry.”Quantity” else: tem.”Inventory”

ProductPrice

Item Base Unit price.

If Live integration GetProductInfo request: the lowest price for the current customer

ProductPriceBefore

Item Base Unit price

ProductLanguageID

If language is parsed: language else: GetUserLanguageCode (method)

ProductName

Description1 (parsed int parameter) or if variant is empty: item.”Description” else itemvariants.”Description”

ProductShortDescription

Description2 (parsed parameter)

ProductStock

If variant not empty: itemLedgerEntry.”Inventory” else item.”Inventory”

ProductWeight

item."Net Weight"

ProductVolume

item."Unit Volume"

ProductManufacturerID

item."Vendor No." 

ProductActive

Booleanitem.”blocked” (false/true)

ProductVariantCounter

Counts number of variants

ProductDefaultUnitID

“Unit_” + item.”Base Unit of Measure”

ProductEAN

itemIdentifier.”Code” or item.”Identifier Code”

ProductIdentifier

Fetched text from XML node “ProductIdentifier”

ProductCurrencyCode

Currency.”Code”

ProductPriceWithVat

Price With VAT

Imports data from the following Business Central tables:

  • Table 8 Language

Dynamicweb destination field

Source 

VariantGroupID

NavUnits

VariantGroupLanguageID

Language.”Code”.  If there is no language in BC: ‘’

VariantGroupName

“DW_units”

VariantGroupLabel

“”

VariantGroupUnit

“true”

Imports data from the following Business Central tables:

  • Table 204 Unit of Measure
  • Table 5402 Unit of Measure Translation (unitofmeasuretranslation)

Dynamicweb destination field

Source 

VariantOptionId

“Unit_” + UnitofMeasure.”Code”

VariantOptionLanguageID

DefaultLangaugeId or unitofmeasuretranslation.”Language Code”

VariantOptionGroupID

“NavUnits”

VartiantOptionName

UnitofMeasure.”Description” or unitofmeasuretranslation.”Description”

Imports data from the following Business Central tables:

  • table 5404 "Item Unit of Measure" (itemUOM)
  • table 18 Customer
  • table 27 Item
  • table 7001 "Price List Line"
  • table 5401 "Item Variant"

 

Dynamicweb destination field

Source 

PriceId

Id generated from composing itemNo, variant, language, currency, quantity, startDate, uom, salesCode and salesType

PriceProductId

Item.”No”

PriceProductVariantId

itemvariants.”Code” or if empty: “”

PriceProductLanguageId

Language

PriceCurrency

LCYCore (parsed parameter) orPriceListLine.”Currency Code”

PriceAmount

PriceListLine."Unit Price"

PriceUnitId

“Unit_” + itemUOM.”Code”

PriceValidFrom

“” or PriceListLine."Starting Date"

PriceValidTo

“” or PriceListLine."Ending Date"

PriceIsInformative

Boolean

PriceUserCustomerNumber

Customer.”No.”

PriceQuantity

itemUOM.”Qty. per Unit of Measure” orPriceListLine."Minimum Quantity"

PriceUnitId

Item Unit of Measure

Imports data from the following Business Central tables:

  • table 27 Item

If item has an “Item category code”:

Dynamicweb destination field

Source 

GroupProductRelationGroupID

item.”Item Category Code”

GroupProductRelationProductID

item.”No.”

GroupProductRelationIsPrimary

“True”

​Imports data from the following Business Central tables:

  • table 5722 "Item Category"

Dynamicweb destination field

Source 

GroupID

ItemCategory.”Code”

GroupLanguageID

setLanguage (parsed parameter) orlanguageId

GroupName

ItemCategory.”Description” or if empty: ItemCategory.”Code” or ItemCategory.”Code” + ”_” + languageId + “_” + “NotTranslated”

GroupInheritCategoryFieldsFromParent

“true” 

​Imports data from the following Business Central tables:

  • table 5722 "Item Category"

Dynamicweb destination field

Source 

ShopGroupShopID

shopId (parsed parameter)

ShopGroupGroupID

ItemCategory.”Code”

Imports data from the following Business Central tables:

  • table 5722 "Item Category"

If ItemCategory.”Parent Category” is not empty:

Dynamicweb destination field

Source 

GroupRelationGroupID

ItemCategory.”Code”

GroupRelationParentID

ItemCategory.”Parent Category”

GroupRelationsSorting

ItemCategory.”Presentation Order” – ItemCategory.”Indentation”

Imports data from the following Business Central tables:

  • table 27 Item

Products request:
 

Dynamicweb destination field

Source 

GroupProductRelationGroupID 

GroupId (from request)

GroupProductRelationProductID 

item No

GroupProductRelationIsPrimary 

True

ProductsGroups request:
 

Dynamicweb destination field

Source 

GroupProductRelationGroupID 

item."Item Category Code"

GroupProductRelationProductID 

item No

GroupProductRelationIsPrimary 

True

Imports data from the following Business Central tables:

  • table 5722 "Item Category"

Dynamicweb destination field

Source 

ShopGroupShopID

shopId (parsed parameter)

ShopGroupGroupID

ItemCategory.”Code”

Dynamicweb destination field

Source 

CategoryId

“ImportedNAVItemAttributes”

CategoryType

“1”

CategoryProductProperties

“true”

Dynamicweb destination field

Source 

CategoryTranslationCategoryId

“ImportedNAVItemAttributes”

CategoryTranslationLanguageId

setLanguage (parsed param) or language (parsed for each lang in langList)

CategoryTranslationCategoryName

“Imported NAV Item Attributes”

Imports data from the following Business Central tables:

  • table 7500 "Item Attribute"
  • table 7501 "Item Attribute Value"

Dynamicweb destination field

Source 

FieldId

ItemCategoryCode + “_” + ItemAttributes.”ID”

FieldCategoryId

ItemCategoryCode

FieldTemplateTag

ItemCategoryCode + “_” + ItemAttributes.ID 

FieldType

“1” (text) or “6” (int) or “7” (decimal) or “15” (option) if empty Fieldtype is set to “1”

FieldDefaultValue

ItemAttributeValues.”ID” or ItemAttributeValues.”Value” or “”

FieldPresentationType

“1”

FieldDoNotRender

“false”

FieldHideEmpty

“false”

Imports data from the following Business Central tables:

  • table 7500 "Item Attribute"
  • table 7503 "Item Attr. Value Translation"

FieldTranslationFieldId

ItemCategoryCode + “_” + ItemAttributes.”ID”

FieldTranslationFieldCategoryId

ItemCategoryCode

FieldTranslationLanguageId

languageId (parsed param)

FieldTranslationFieldLabel

ItemAttributeTranslation.”Name” or ItemAttributes.”Name”

Imports data from the following Business Central tables:

  • table 7500 "Item Attribute"
  • table 7501 "Item Attribute Value"

FieldOptionId

ItemCategoryCode + “_” + ItemAttributes.”ID” + “_” + ItemAttributeValues.”ID”

FieldOptionFieldId

ItemCategoryCode + “_” + ItemAttributes.”ID”

FieldOptionName

ItemAttributeValues.”Value”

FieldOptionValue

ItemAttributeValues.”ID”

FieldTranslationFieldOptions

Composed string representing default options

Imports data from the following Business Central tables:

  • table 7500 "Item Attribute"
  • table 7501 "Item Attribute Value"
  • table 7503 "Item Attr. Value Translation"

EcomFieldOptionTranslationOptionID

ItemCategoryCode + “_” + ItemAttributes.”ID” + “_” + ItemAttributeValues.”ID”

EcomFieldOptionTranslationLanguageID

setLanguage (parsed parameter)

EcomFieldOptionTranslationName

ItemAttributeValues.”Value”

EcomFieldOptionTranslationOptionID

ItemCategoryCode + “_” + ItemAttributes.”ID” + “_” + ItemAttributeValueTranslation.”ID”

EcomFieldOptionTranslationLanguageID

ItemAttributeValueTranslation."Language Code"

EcomFieldOptionTranslationName

ItemAttributeValueTranslation.”Name”

Imports data from the following Business Central tables:

  • table 7500 "Item Attribute"
  • table 7501 "Item Attribute Value"
  • table 7505 "Item Attribute Value Mapping"

FieldValueFieldId

itemCategoryCode + “_” + ItemAttributeValueMapping."Item Attribute ID"

FieldValueFieldCategoryId

itemCategoryCode

FieldValueProductId

ItemAttributeValueMapping."No."

FieldValueProductVariantId

“”

FieldValueProductLanguageId

setLanguage (parsed parameter)

'FieldValueValue'

ItemAttributeValues.”ID” or ItemAttributeValues.”Value”

Function AddSalesHeader

Imports data from the following Business Central tables:

  • table 36 "Sales Header"

All table fields for orders that are not from the Customer Center are added with a prefix of “Order”.

Prefix + Id

Salesheader.”No.”

Prefix + CurrencyCode

salesheader."Currency Code"

Prefix + Date

salesheader."Order Date" 

Prefix + PaymentMethod

salesheader."Payment Method Code"

Prefix + CustomerName

salesheader."Sell-to Customer Name"

Prefix + CustomerAddress

salesheader."Sell-to Address"

Prefix + CustomerAddress2

salesheader."Sell-to Address 2"

Prefix + CustomerCity

salesheader."Sell-to City"

Prefix + CustomerCountryCode

salesheader."Sell-to Country/Region Code"

Prefix + CustomerEmail

“”

Prefix + CustomerFax

“”

Prefix + CustomerPhone

“”

Prefix + CustomerZip

salesheader."Ship-to Post Code"

Prefix + DeliveryName

salesheader."Ship-to Name"

Prefix + DeliveryAddress

salesheader."Ship-to Address"

Prefix + DeliveryAddress2 

salesheader."Ship-to Address 2"

Prefix + DeliveryCity

salesheader."Ship-to City"

Prefix + DeliveryCountryCode

salesheader."Ship-to Country/Region Code"

Prefix + DeliveryEmail

“”

Prefix + DeliveryFax

“”

Prefix + DeliveryPhone

“”

Prefix + DeliveryZip

salesheader."Ship-to Post Code"

Prefix + PriceWIthVat

Order Price With VAT 

Prefix + PriceWithoutVat

Order Price Without VAT

Prefix + PriceVat

Order Price VAT

Prefix + SalesDiscount

Order Sales Discount 

 

Function AddSalesCrMemoheader

Imports data from the following Business Central tables:

  • table 114 "Sales Cr.Memo Header" (salescrmemoheader)

Id

Salescrmemoheader.”No.”

CurrencyCode

salescrmemoheader."Currency Code"

PaymentMethodName

salescrmemoheader."Payment Method Code"

ShippingMethodName

salescrmemoheader."Shipment Method Code"

CustomerName

salescrmemoheader."Sell-to Customer Name"

CustomerAddress

salescrmemoheader."Sell-to Address"

CustomerAddress2

salescrmemoheader."Sell-to Address 2"

CustomerCity

salescrmemoheader."Sell-to City"

CustomerCountryCode

salescrmemoheader."Sell-to Country/Region Code"

CustomerEmail

“”

CustomerFax

“”

CustomerPhone

“”

CustomerZip

salescrmemoheader."Ship-to Post Code"

DeliveryName

salescrmemoheader."Ship-to Name"

DeliveryAddress

salescrmemoheader."Ship-to Address"

DeliveryAddress2 

salescrmemoheader."Ship-to Address 2"

DeliveryCity

salescrmemoheader."Ship-to City"

DeliveryCountryCode

salescrmemoheader."Ship-to Country/Region Code"

DeliveryEmail

“”

DeliveryFax

“”

DeliveryPhone

“”

DeliveryZip

salescrmemoheader."Ship-to Post Code"

PriceWIthVat

OrderPriceWithVAT 

PriceWithoutVat

OrderPriceWithoutVAT 

PriceVat

OrderPriceVAT 

SalesDiscount

OrderSalesDiscount 

 

Function AddSalesInvHeader

Imports data from the following Business Central tables:

  • table 112 "Sales Invoice Header" (salesInvheader)

Id

SalesInvheader.”No.”

CurrencyCode

salesInvheader."Currency Code"

Date

salesInvheader."Order Date" 

PaymentMethodName

salesInvheader."Payment Method Code"

ShippingMethodName

salesInvheader."Shipment Method Code"

CustomerName

salesInvheader."Sell-to Customer Name"

CustomerAddress

salesInvheader."Sell-to Address"

CustomerAddress2

salesInvheader."Sell-to Address 2"

CustomerCity

salesInvheader."Sell-to City"

CustomerCountryCode

salesInvheader."Sell-to Country/Region Code"

CustomerEmail

“”

CustomerFax

“”

CustomerPhone

“”

CustomerZip

salesInvheader."Ship-to Post Code"

DeliveryName

salesInvheader."Ship-to Name"

DeliveryAddress

salesInvheader."Ship-to Address"

DeliveryAddress2 

salesInvheader."Ship-to Address 2"

DeliveryCity

salesInvheader."Ship-to City"

DeliveryCountryCode

salesInvheader."Ship-to Country/Region Code"

DeliveryEmail

“”

DeliveryFax

“”

DeliveryPhone

“”

DeliveryZip

salesInvheader."Ship-to Post Code"

PriceWithVAT

OrderPriceWithVAT 

PriceWithoutVAT

OrderPriceWithoutVAT 

PriceVAT

OrderPriceVAT

SalesDiscount

OrderSalesDiscount

ShippingFee

“”

Function AddSalesLine

Imports data from the following Business Central tables:

  • table 37 "Sales Line"
  • table 36 "Sales Header"

All table field names for order lines that are not from the Customer Center are added with a prefix of “OrderLine”.

Some field names are also added with either an idPrefix (“Id”) or a VatPrefix (“Vat”) if the cancelAdd parameter is not set to true.

Prefix + ProductNumber

salesLine.”No.”

Prefix + ProductVariant + idPrefix

salesLine."Variant Code"

Prefix + UnitId*

“Unit_” + salesLine."Unit of Measure Code"

Prefix + ParentLine + idPrefix**

salesLine."Line No.”

Prefix + Type

“3” (if it is product discount line), 1 if it is order discount or “0” (if it is regular product order line)

Prefix + Quantity

 salesLine.”Quantity”

Prefix + DiscountId***

If UseDynamciwebDiscount is ON the OrderLineDiscountId value from the request is inserted.

Prefix + ProductName** ***

If UseDynamciwebDiscount is ON the OrderLineDiscountName value from the request is inserted.

Prefix + PriceWith + vatPrefix** ***

Price WithWAT (calculated variable)

Prefix + UnitPriceWith + vatPrefix

Unit Price With VAT (calculated variable) 

Prefix + PriceWithout + VatPrefix

Price Without VAT (calculated variable)

Prefix + UnitPriceWithout + VatPrefix

Unit price Without VAT (calculated variable)

Prefix + DiscountPercentage 

salesLine."Line Discount %"

Prefix + Price + VatPrefix

Calculates PriceWithWAT – PriceWithoutWAT

Prefix + UnitPrice + VatPrefix

Calculates (UnitPriceWithWAT – UnitPriceWithoutWAT) if salesLine.”Quantity” is not 0, the UnitPrice calculation is divided by the quantity.

Prefix + Price + VatPrefix + Percent

salesLine."VAT %"

Prefix + UnitPrice + VatPrefix + Percent

salesLine."VAT %"

*only if isUomRequest is true in the request and “Unit of Measure Code” in the salesLine.”Variant Code” is not empty.

**Only if parent is not empty.

***Only if dynamicwebDiscountId is not empty.

Function AddNavOrderDiscountSalesLine

Imports data from the following Business Central tables:

  • table 325 "VAT Posting Setup"
  • table 36 "Sales Header"

OrderLineProductNumber

””

OrderLineProductVariantID

””

OrderLineId

””

OrderLineQuantity

”1”

OrderLineType

”1”

OrderLinePriceWithoutVat

Discount Amount without VAT

OrderLineUnitPriceWithoutVat

Discount Amount without VAT

OrderLinePriceWithVat

Considers if any sales line has a different Vat percent and if so, uses the invoiceDiscountAmountWithVat variable. Otherwise the variable is calculated by using VATPostingSetup.”VAT %” and thediscount amount.

OrderLineUnitPriceWithVat

Considers if any sales line has a different Vat percent and if so, uses the invoiceDiscountAmountWithVat variable. Otherwise the variable is calculated by using VATPostingSetup.”VAT %” and thediscount amount.

OrderLinePriceVat

Calculates TempWithWAT – TempWithoutWAT (rounded to two decimal points)

OrderLineUnitPriceVat

Calculates TempWithWAT – TempWithoutWAT (rounded to two decimal points)

OrderLinePriceVatPercent

VatPercent, variable, that holds the value from VATPostingSetup."VAT %" unless VATPostingSetup."VAT Calculation Type"is “Reverse Charge VAT”

OrderLineUnitPriceVatPercent

VatPercent, variable, that holds the value from VATPostingSetup."VAT %" unless VATPostingSetup."VAT Calculation Type"is “Reverse Charge VAT”

 

Function AddSalesCrMemoLine

Imports data from the following Business Central tables:

  • table 114 "Sales Cr.Memo Header" (salescrmemoheader)
  • table 115 "Sales Cr.Memo Line" (SalesCrMemoLine)
  • table 37 "Sales Line"

 

ProductNumber

salesCrMemoLine.”No.”

ProductVariantID

SalesCrMemoLine."Variant Code"

ParentLineID (only if parent exists)

salesLine."Line No."

Type

“3” (if parent is not empty) or “0” (if parent is empty)

Quantity

“1” (if parent is not empty) orsalesCrMemoLine.”Quantity”

PriceWithVAT

salesCrMemoLine."Line Discount Amount" or TempWithVAT (calculated variable, quantity * unit price)

UnitPriceWithVAT

salesCrMemoLine."Unit Price" to string) orcalculated UnitPrice from salesCrMemoLine.”Unit Price” and salesCrMemoLine.”VAT %”

PriceWithoutVAT

TempWithoutVAT (calculated variable) or salesCrMemoLine."Line Discount Amount"

UnitPriceWithoutVat

Calculation from salesCrMemoLine."Unit Price" and salesCrMemoLine."VAT %" or salesCrMemoLine."Unit Price"

DiscountPercentage 

salesCrMemoLine."Line Discount %"

PriceVAT

Calculates TempWithWAT – TempWithoutWAT (variables)

PriceVATPercent

salesCrMemoLine."VAT %"

UnitPriceVATPercent

salesCrMemoLine."VAT %"

 

Function AddSalesInvLine

Imports data from the following Business Central tables:

  • Table 113 "Sales Invoice Line" (salesInvLine)
  • table 37 "Sales Line"

ProductNumber

salesInvLine.”No.”

ProductVariantID

SalesInvLine."Variant Code"

ParentLineID (only if parent exists)

salesLine."Line No."

Type

“3” (if parent is not empty) or “0” (if parent is empty)

Quantity

“1” (if parent is not empty) orsalesInvLine.Quantity

PriceWithVAT

salesInvLine."Line Discount Amount" or TempWithVAT (calculated variable)

UnitPriceWithVAT

salesInvLine."Unit Price" or calculated UnitPrice from salesInvLine.”Unit Price”and salesInvLine.”VAT %”

PriceWithoutVAT

TempWithoutVAT (calculated variable) or salesInvLine."Line Discount Amount"

UnitPriceWithoutVat

Calculation from salesInvLine."Unit Price"and salesInvLine."VAT %" or salesInvLine."Unit Price"

DiscountPercentage 

salesInvLine."Line Discount %"

PriceVAT

Calculates TempWithWAT – TempWithoutWAT (variables)

PriceVATPercent

salesInvLine."VAT %"

UnitPriceVATPercent

salesInvLine."VAT %"