Skip to main content

NC365 Attribute API (11260727)

SetAttributeValue

SetAttributeValue(ItemNo: Code[20]; AttributeCode: Code[50]; "Value": Variant)

Sets the attribute value for a specific item and attribute code.The value is of type Variant. So it can be any data type. The system will automatically try to convert the value to the data type that is set for the given attribute.If the attribute data type is drop down, then the drop down option will automatically be created if it does not yet exist, and the drop down value will be set to this new option.If the attribute data type is multi-select, you can supply one or more values (JsonArray), and these values will be added to the list of selected options.If you want the new list of selected options to replace the existing list, please call ClearAttributeValue(..) first.

Parameters:

  • ItemNo - The Item No. for which you want to set the attribute value
  • AttributeCode - The Attribute Code for which you want to set the attribute value
  • Value - The value that will be converted to the data type of the selected attribute

Returns: nothing

SetAttributeValue

SetAttributeValue(ItemNo: Code[20]; VariantCode: Code[10]; AttributeCode: Code[50]; "Value": Variant)

Sets the attribute value for a specific item, variant code and attribute code.The value is of type Variant. So it can be any data type. The system will automatically try to convert the value to the data type that is set for the given attribute.If the attribute data type is drop down, then the drop down option will automatically be created if it does not yet exist, and the drop down value will be set to this new option.If the attribute data type is multi-select, you can supply one or more values (JsonArray), and these values will be added to the list of selected options.If you want the new list of selected options to replace the existing list, please call ClearAttributeValue(..) first.

Parameters:

  • ItemNo - The Item No. for which you want to set the attribute value
  • VariantCode - The Variant Code for which you want to set the attribute value
  • AttributeCode - The Attribute Code for which you want to set the attribute value
  • Value - The value that will be converted to the data type of the selected attribute

Returns: nothing

SetAttributeDropDownValueById

SetAttributeDropDownValueById(ItemNo: Code[20]; VariantCode: Code[10]; AttributeCode: Code[50]; DropDownValueId: Integer)

Sets the drop down or multi-select attribute value for a specific item, variant code, attribute code and dropdownvalueid.Use this function if you need to work directly with the ID's of attribute option values.If the attribute data type is drop down, the drop down option value id will be the selected value.If the attribute data type is multi-select, the new value will be added to the list of selected values.If you want the new value to replace any existing selected option value, please call ClearAttributeValue(..) first.

Parameters:

  • ItemNo - The Item No. for which you want to set the attribute value
  • VariantCode - The Variant Code for which you want to set the attribute value
  • AttributeCode - The Attribute Code for which you want to set the attribute value
  • DropDownValueId - The integer ID of the drop down option value you want to set

Returns: nothing

SetConfigurableAttribute

SetConfigurableAttribute(ItemNo: Code[20]; AttributeCode: Code[50]; IsConfigurable: Boolean)

Mark an item attribute as a configurable attribute.Use this function when automatically creating configurable items. Be sure to also set the unique attribute values for all underlying items or item variants.

Parameters:

  • ItemNo - The Item No. for which you want to specify a configurable attribute
  • AttributeCode - The Attribute Code for which you want to specify the configurable value
  • IsConfigurable - Specifies whether this attribute is a configurable attribute

Returns: nothing

ClearAttributeValue

ClearAttributeValue(ItemNo: Code[20]; VariantCode: Code[10]; AttributeCode: Code[50])

Remove any attribute value that is specified for a given item, variant code and attribute code.

Parameters:

  • ItemNo - The Item No. for which you want to remove the value
  • VariantCode - The Variant Code for which you want to remove the value
  • AttributeCode - The Attribute Code for which you want to remove the value

Returns: nothing

CopyAttributeValues

CopyAttributeValues(FromItemNo: Code[20]; ToItemNo: Code[20])

Copy attribute all attribute values from one Magento item to another.If the attribute set code on the target item is empty, it will be set to the same attribute set code as the source item.If both items already have an attribute set code specified, then both should have the same value in order to be able to copy attribute values.

Parameters:

  • FromItemNo - The source Magento item
  • ToItemNo - The target Magento item

Returns: nothing

CopyAttributeValues

CopyAttributeValues(FromItemNo: Code[20]; FromVariantCode: Code[10]; ToItemNo: Code[20]; ToVariantCode: Code[10])

Copy attribute all attribute values from one Magento item variant to another.If the attribute set code on the target item is empty, it will be set to the same attribute set code as the source item.If both items already have an attribute set code specified, then both should have the same value in order to be able to copy attribute values.

Parameters:

  • FromItemNo - The source Magento item
  • FromVariantCode - The source Magento item variant
  • ToItemNo - The target Magento item
  • ToVariantCode - The target Magento item variant

Returns: nothing

CopyAttributeValues

CopyAttributeValues(FromItemNo: Code[20]; FromVariantCode: Code[10]; ToItemNo: Code[20]; ToVariantCode: Code[10]; StoreCode: Code[50])

Copy attribute all attribute values from one Magento item variant to another, for a specific store.If the attribute set code on the target item is empty, it will be set to the same attribute set code as the source item.If both items already have an attribute set code specified, then both should have the same value in order to be able to copy attribute values.

Parameters:

  • FromItemNo - The source Magento item
  • FromVariantCode - The source Magento item variant
  • ToItemNo - The target Magento item
  • ToVariantCode - The target Magento item variant
  • StoreCode - The store code for which you want to copy attribute values

Returns: nothing

AddAttributeOptionValue

AddAttributeOptionValue(AttributeCode: Code[50]; OptionValue: Text[50])

Add an option value to a dropdown or multi-select attribute.

Parameters:

  • AttributeCode - The Attribute Code for which you want to add the new option value
  • OptionValue - The option value to add

Returns: nothing

AddAttributeOptionValue

AddAttributeOptionValue(AttributeCode: Code[50]; OptionValue: Text[50]; Labels: Dictionary of [Code[50], Text[50]])

Add an option value to a dropdown or multi-select attribute and set translation labels.

Parameters:

  • AttributeCode - The Attribute Code for which you want to add the new option value
  • OptionValue - The option value to add
  • Labels - A dictionary with store codes and label values

Returns: nothing

AddAttributeGroup

AddAttributeGroup(AttributeSetCode: Code[50]; AttributeGroupCode: Code[50])

Add an attribute group to an attribute set.

Parameters:

  • AttributeSetCode - The Attribute Set to which you want to add this new group
  • AttributeGroupCode - The new attribute group code

Returns: nothing

AddAttributeGroup

AddAttributeGroup(AttributeSetCode: Code[50]; AttributeGroupCode: Code[50]; Description: Text[100])

Add an attribute group to an attribute set.

Parameters:

  • AttributeSetCode - The Attribute Set to which you want to add this new group
  • AttributeGroupCode - The new attribute group code
  • Description - The new attribute group description

Returns: nothing

ItemHasAttribute

ItemHasAttribute(ItemNo: Code[20]; AttributeCode: Code[50]): Boolean

Check to see if an item attribute combination exists.

Parameters:

  • ItemNo - The Item No. for which you want to perform this check
  • AttributeCode - The Attribute Code for which you want to perform this check

Returns: Boolean that indicates whether the item attribute combination exists

GetOptionAdminValue

GetOptionAdminValue(MagentoId: Text[100]): Text

Get the admin value for a drop down option based on its Magento id.

Parameters:

  • MagentoId - The Magento id (integer) for which you want to retrieve the admin value

Returns: The admin value (code) specified for the requested drop down option

GetAttributeValue

GetAttributeValue(ItemNo: Code[20]; AttributeCode: Code[50]): Variant

Get attribute value from an item for a specific attribute.

Parameters:

  • ItemNo - The Item No
  • AttributeCode - The Attribute Code

Returns: The value (variant) for the specified item and attribute code

Fully automated installation and onboarding

Install via AppSource

Click on the AppSource button, install the free trial and just follow the instructions