# CMS_AddCustomUserInventory

> Adds a persistent CustomUserInventory row to the database.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/cms-functions/cms-addcustomuserinventory/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Adds a persistent CustomUserInventory row to the database.

### Syntax

CMS_AddCustomUserInventory(category, entry, value, valuetype) as boolean

User packages are not supported in PowerPacks

### Parameters

#### category (String)

Category name

#### entry (String)

Variable name

#### value (string)

Value (string)

If you are inserting a Time (valuetype: "T") it must be set in epoch-time, meaning seconds since January 1. 1970. The scripting library has a function called GetEpochTime, which will convert a date to seconds since 1-1-1970.

If you want to use 'now' as the value, you can either insert;

- an empty string ("")
- or the value ("0")

#### valuetype (string)

The type of the value

Valid valuetypes are;

- "S" for string
- "I" for integer
- "T" for time

### Example

**VBScript**

```vb
If bStatus Then bStatus = CMS_AddCustomUserInventory("Department", "Name", "Sales", "S")
If bStatus Then bStatus = CMS_AddCustomUserInventory("Department", "Office", "15", "I")
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[CMS_RemoveCustomUserInventory](/capainstaller/vb-scripting-library/cms-functions/cms-removecustomuserinventory/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/) [Business Unit support](/capainstaller/vb-scripting-library/addendum/business-unit-support/)
