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: Code[20]; SimpleItemNo: Code[20])
Link a simple item to a configurable item

procedure ItemExists(ItemNo: Code[20]; StoreCode: Code[50]): Boolean
Does a web item for a certain item (no) already exist?

NC365 Attribute API (codeunit 11260727)

procedure SetAttributeValue(ItemNo: Code[20]; VariantCode: Code[10]; AttributeCode: Code[50]; "Value": Variant)
Set any attribute value for a certain item, variant and attribute code

procedure SetConfigurableAttribute(ItemNo: Code[20]; AttributeCode: Code[50]; IsConfigurable: Boolean)
Mark an attribute as a configurable attribute

procedure ClearAttributeValue(ItemNo: Code[20]; VariantCode: Code[10]; AttributeCode: Code[50])
Clear an attribute value

procedure CopyAttributeValues(FromItemNo: Code[20]; ToItemNo: Code[20])
Copy attribute values from one item to another

procedure CopyAttributeValues(FromItemNo: Code[20]; FromVariantCode: Code[10]; ToItemNo: Code[20]; ToVariantCode: Code[10])
Copy attribute values from one web item variant to another

procedure CopyAttributeValues(FromItemNo: Code[20]; FromVariantCode: Code[10]; ToItemNo: Code[20]; ToVariantCode: Code[10]; StoreCode: Code[50])
Copy attribute values from one web item variant to another, only for a specific store

procedure AddAttributeOptionValue(AttributeCode: Code[50]; OptionValue: Text[50])
Add an option value to a dropdown or multi-select attribute

procedure AddAttributeOptionValue(AttributeCode: Code[50]; OptionValue: Text[50]; Labels: Dictionary of [Code[50], Text[50]])
Add multiple option values to a dropdown or multi-select attribute

procedure AddAttributeGroup(AttributeSetCode: Code[50]; AttributeGroupCode: Code[50])
Add an attribute group to an attribute set

procedure AddAttributeGroup(AttributeSetCode: Code[50]; AttributeGroupCode: Code[50]; Description: Text[100])
Add an attribute group to an attribute set and set the group description

NC365 Inventory API (codeunit 11260732)

procedure CalculateInventory(ItemNo: Code[20]): Decimal
Return web inventory for an item

procedure CalculateInventory(ItemNo: Code[20]; VariantCode: Code[10]): Decimal
Return web inventory for an item variant

procedure UpdateInventory(ItemNo: Code[20])
Trigger inventory (re)calculation for an item

procedure UpdateInventory(ItemNo: Code[20]; VariantCode: Code[10])
Trigger inventory (re)calculation for an item variant

procedure UpdateInventory(ItemNo: Code[20]; Inventory: Decimal)
Set web inventory for an item

procedure UpdateInventory(ItemNo: Code[20]; VariantCode: Code[10]; 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: Code[10]; var ShippingAgentCode: Code[10]; var ShippingAgentServiceCode: Code[10]; var GLAccountNo: Code[20])
Get all shipping method details by staging order header

procedure GetPaymentMethodDetails(StagingOrderHeader: Record "NC365 Staging Order Header"; var PaymentMethodCode: Code[10]; var PaymentTermsCode: Code[10])
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 Sales 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 Sales 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 Sales Order Attributes module

NC365 Customer API

Will be added in the next release (2021/7/14)

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