ISInventoryUtils.AddInventoryAuditRecord

Description

This function adds the inventory audit record.

Syntax

object.AddInventoryAuditRecord(aMoveTypeCode, aLocationCode, aStockItem)

Part Attribute Type Description
object Required
The object always implements the ISInventoryUtils interface
aMoveTypeCode In, Required
string
The code of the movement type
aLocationCode In, Required
string
The code of the location
aStockItem In, Required
The single unit of stock

Return Value

ISInventoryAuditRecord

Returns the added inventory audit record.

Example

Display the number of the inventory audit records before and after adding.

Dim aStockItems
Dim aStockItem
Dim aFilter
Dim aInventoryAudits
Dim i
Dim aMessage
Dim aTrans

Set aTrans = Profile.StartMapTransaction

set aFilter = InventoryUtils.CreateStockItemFilter
aFilter.Code = "BB"
set aStockItems = InventoryUtils.LoadStockItems(aFilter)
set aStockItem = aStockItems.Item(i)

set aFilter = InventoryUtils.CreateInventoryAuditFilter
aFilter.StockItem = aStockItem
set aInventoryAudits = InventoryUtils.LoadInventoryAudits(aFilter) 

aMessage = "The number of Inventory Audit Records before adding is " &_
  aInventoryAudits.Count & vbNewLine

InventoryUtils.AddInventoryAuditRecord "M", "COMM", aStockItem

aTrans.Snapshot
set aInventoryAudits = InventoryUtils.LoadInventoryAudits(aFilter) 
aMessage = aMessage & "The number of Inventory Audit Records after adding is " &_
  aInventoryAudits.Count

Profile.MsgBox(aMessage)    
Note:

Version information

Added in v7.8.0