Skip to content

CMS_AddCustomUserInventory

Adds a persistent CustomUserInventory row to the database. Use the function in a user package. The row is added to the current user.

CMS_AddCustomUserInventory(category, entry, value, valuetype) As Boolean

User packages are not supported in PowerPacks

Category name

Variable name

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”)

The type of the value

Valid valuetypes are;

  • “S” for string
  • “I” for integer
  • “T” for time

Any other value type makes the function fail. If the entry already exists, its value is updated.

Boolean. True if the function completed successfully.

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

Scripting Guidelines

CMS_RemoveCustomUserInventory Constants Package Property Variables Business Unit support