To make working with our data models as easy as possible, we have added a long list of internal API’s to our solution. This means that as a developer you don’t have to study how complex table structures like the item attribute values are stored. You simple use the SetAttributeValue method, and we will take care of the rest.

Below is a list of all existing API’s and a description of what they do. You can also install the software, add a reference to the extension in your own solution, and use a tool like AL Object Designer to browse through our tables and API codeunits.

Be aware, we have designed these API’s to simplify complex tasks. For things which can easily be done through standard code, like just updating a product or customer name field, you will not find an API in this list.

NC365 Item API (codeunit 11260729)
procedure CreateNC365Item(Item: Record Item)
Create a web item from a standard BC item.

procedure CreateNC365ItemVariant(ItemVariant: Record “Item Variant”)
Create a web item from a standard BC item variant.

procedure AssignConfigurableItem(ConfigurableItemNo: Code20; SimpleItemNo: Code20)
Link a simple item to a configurable item.

procedure ItemExists(ItemNo: Code20; StoreCode: Code50): Boolean
Does a web item for a certain item (no) already exist?

procedure AssignRelatedItem(ItemNo: Code20; LinkedItemNo: Code20; Position: Integer)
Assign a related item to another item

procedure AssignUpSellItem(ItemNo: Code20; LinkedItemNo: Code20; Position: Integer)
Assign an up sell item to another item

procedure AssignCrossSellItem(ItemNo: Code20; LinkedItemNo: Code20; Position: Integer)
Assign a cross sell item to another item

procedure AssignGroupedItem(ItemNo: Code20; LinkedItemNo: Code20; Position: Integer)
Assign a grouped item to a parent item

procedure UnassignConfigurableItem(ItemNo: Code20; LinkedItemNo: Code20)
Unassign a simple item from a configurable item

procedure UnassignRelatedItem(ItemNo: Code20; LinkedItemNo: Code20)
Unassign a related item from a parent item

procedure UnassignUpSellItem(ItemNo: Code20; LinkedItemNo: Code20)
Unassign an up sell item from a parent item

procedure UnassignCrossSellItem(ItemNo: Code20; LinkedItemNo: Code20)
Unassign a cross sell item from a parent item

procedure UnassignGroupedItem(ItemNo: Code20; LinkedItemNo: Code20)
Unassign a grouped item from a parent item

NC365 Attribute API (codeunit 11260727)
procedure SetAttributeValue(ItemNo: Code20; VariantCode: Code10; AttributeCode: Code50; “Value”: Variant)
Set any attribute value for a certain item, variant and attribute code.

procedure SetConfigurableAttribute(ItemNo: Code20; AttributeCode: Code50; IsConfigurable: Boolean)
Mark an attribute as a configurable attribute.

procedure ClearAttributeValue(ItemNo: Code20; VariantCode: Code10; AttributeCode: Code50)
Clear an attribute value.

procedure CopyAttributeValues(FromItemNo: Code20; ToItemNo: Code20)
Copy attribute values from one item to another.

procedure CopyAttributeValues(FromItemNo: Code20; FromVariantCode: Code10; ToItemNo: Code20; ToVariantCode: Code10)
Copy attribute values from one web item variant to another.

procedure CopyAttributeValues(FromItemNo: Code20; FromVariantCode: Code10; ToItemNo: Code20; ToVariantCode: Code10; StoreCode: Code50)
Copy attribute values from one web item variant to another, only for a specific store.

procedure AddAttributeOptionValue(AttributeCode: Code50; OptionValue: Text50)
Add an option value to a dropdown or multi-select attribute.

procedure AddAttributeOptionValue(AttributeCode: Code50; OptionValue: Text50; Labels: Dictionary of [Code50, Text50])
Add an option value and store view specific labels to a dropdown or multi-select attribute.

procedure AddAttributeGroup(AttributeSetCode: Code50; AttributeGroupCode: Code50)
Add an attribute group to an attribute set.

procedure AddAttributeGroup(AttributeSetCode: Code50; AttributeGroupCode: Code50; Description: Text100)
Add an attribute group to an attribute set and set the group description.

NC365 Inventory API (codeunit 11260732)
procedure CalculateInventory(ItemNo: Code20): Decimal
Return web inventory for an item.

procedure CalculateInventory(ItemNo: Code20; VariantCode: Code10): Decimal
Return web inventory for an item variant.

procedure UpdateInventory(ItemNo: Code20)
Trigger inventory (re)calculation for an item.

procedure UpdateInventory(ItemNo: Code20; VariantCode: Code10)
Trigger inventory (re)calculation for an item variant.

procedure UpdateInventory(ItemNo: Code20; Inventory: Decimal)
Set web inventory for an item.

procedure UpdateInventory(ItemNo: Code20; VariantCode: Code10; Inventory: Decimal)
Set web inventory for an item variant.

procedure RecalculateInventory(IncludeVariants: Boolean)
Recalculate web inventory for all items (and variants).

NC365 Sales Order API (codeunit 11260734)
procedure GetMagentoOrder(orderID: Integer): JsonObject
Retrieve a specific Magento order.

procedure GetMagentoOrder(StagingOrderHeader: Record “NC365 Staging Order Header”): JsonObject
Retrieve a specific Magento order.

procedure UpdateAllOpenStagingOrders()
Update all open staging orders.

procedure UpdateStagingOrder(SalesHeader: Record “Sales Header”)
Update a specific staging order by sales header.

procedure UpdateStagingOrder(incrementID: Text)
Update a specific staging order by Magento sales order increment id.

procedure UpdateStagingOrder(orderID: Integer)
Update a specific staging order by Magento sales order id.

procedure UpdateStagingOrder(StagingOrderHeader: Record “NC365 Staging Order Header”)
Update a specific staging order by staging order header.

procedure CancelStagingOrder(SalesHeader: Record “Sales Header”)
Cancel a specific staging order by sales order.

procedure CancelStagingOrder(incrementID: Text)
Cancel a specific staging order by Magento sales order increment id.

procedure CancelStagingOrder(orderID: Integer)
Cancel a specific staging order by Magento sales order id.

procedure CancelStagingOrder(StagingOrderHeader: Record “NC365 Staging Order Header”)
Cancel a specific staging order by staging order header.

procedure GetShipmentMethodDetails(StagingOrderHeader: Record “NC365 Staging Order Header”; var ShipmentMethodCode: Code10; var ShippingAgentCode: Code10; var ShippingAgentServiceCode: Code10; var GLAccountNo: Code20)
Get all shipping method details by staging order header.

procedure GetPaymentMethodDetails(StagingOrderHeader: Record “NC365 Staging Order Header”; var PaymentMethodCode: Code10; var PaymentTermsCode: Code10)
Get all payment method details by staging order header.

procedure GetStagingOrderAttributes(StagingOrderHeader: Record “NC365 Staging Order Header”): Dictionary of [Text, Text]
Get all custom order attributes by staging order header.
Requires Amasty Custom Order Attributes module.

procedure GetStagingOrderAttributes(StagingOrderHeader: Record “NC365 Staging Order Header”; AttributeCode: Text): Text
Get a specific custom order attribute value by staging order header and attribute code
Requires Amasty Custom Order Attributes module.

procedure GetStagingOrderAttributes(StagingOrderLine: Record “NC365 Staging Order Line”): Dictionary of [Text, Text]
Get all custom order line attributes by staging order line
Requires Amasty Custom Order Attributes module.

NC365 Customer API
procedure CreateNC365Customer(Customer: Record “Customer”)
Convert a standard customer in to a Magento customer.

procedure ReleaseNC365Customer(CustomerNo: Code20)
Convert a standard customer in to a Magento customer.

procedure ReleaseNC365Customer(NC365Customer: Record “NC365 Customer”)

procedure SendWelcomeEmail(CustomerNo: Code20)

procedure SendWelcomeEmail(NC365Customer: Record “NC365 Customer”)

procedure SetAttributeValue(CustomerNo: Code20; AttributeCode: Code50; “Value”: Variant)

procedure ClearAttributeValue(CustomerNo: Code20; AttributeCode: Code50)

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment