--- myst: substitutions: ico_method: |- ```{image} /img/code_reference/net_library/method.ico :width: 15px ``` ico_prop: |- ```{image} /img/code_reference/net_library/prop.ico :width: 15px ``` --- # IItemService Interface Contains functionality to deal with items and BOM. **Namespace:** bcpDevKit\ **Assembly:** bcpDevKit.dll ## Syntax ```csharp public interface IItemService ``` ## Methods | Type | Name | Description | |-----------------------------|-------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------| | {{ico_method}} ItemMaster | AddItem(string itemNumber, string cat, string titel, string desc) | Adds an Item to the package. The item number will be an unique identifier in vault and it should be unique, for instance “100001”. | | {{ico_method}} ItemMaster | GetItem(string itemNumber) | Returns the item, which has the passed itemNumber if it exists. | | {{ico_method}} BOMComponent | AddFileLinkToItem(ItemIteration itemVersion, FileIteration fileVersion) | Links a file version to a specific item version. | ## Remarks *AddFileLinkToItem* ensures that all files are correctly linked to the item. It handles if the link should be primary, secondary or tertiary. If the file is a content center file, a StandardComponent link will be created. If the file has design files, they will be linked as tertiary links to the item. Files marked as ConfigurationFactory will only be attached to the item. You can get the latest iteration of an item/file with itemMaster.LatestIteration or file.LatestIteration. ## Examples **You have to set the creation date otherwise, the Vault client brings the error message "1417 GetBOMFailedNothingEffective" when accessing that item.** ```csharp var item = bcpService.ItemService.AddItem("9992", "Document", "Title 9992", "Desc 9992"); item.LatestIteration.SetCreateDateFormatted(DateTime.Today); ```