Overview
The InventTable is the core item master data table that stores product information, inventory settings, and item configurations for all inventory items in D365 F&O.
Key Fields
| Field Name | Type | Description | Required |
|---|---|---|---|
ItemId |
ItemId | Unique item identifier | Yes |
Name |
Name | Item name | Yes |
ItemGroupId |
ItemGroupId | Item group classification | Yes |
Key Methods
- find() - Find item by item ID
- exist() - Check if item exists
Common Usage Examples
Finding a Record
// Find record by ID
InventTable inventtable = InventTable::find("RECORD_ID");
if (inventtable.RecId)
{
info(strFmt("Record found: %1", inventtable.displayValue()));
}
// Check if record exists
if (InventTable::exist("RECORD_ID"))
{
// Record exists, proceed with logic
}
Creating a New Record
// Create new record
InventTable inventtable;
// Set required fields
// inventtable.FieldName = "Value";
if (inventtable.validateWrite())
{
inventtable.insert();
info("Record created successfully");
}