Issue
The powerGate BOM Window from the "ERP BOM" tab runs into an error when using a raw material: "Passed value for entity 'Item' for mandatory property with name 'Number' cannot be NULL".
Cause
For raw materials a new object is created where the 'Part Number' property is assigned the value of the "raw material number property. In the Check-Boms function the '_PartNumber' property is used to check if the entity already exists in ERP, which is empty for the PowerShell object.
Solution
Add the '_PartNumber' property to the object creation
- Open the file "C:\ProgramData\coolOrange\Client Customizations\Sample.Tab-File-ErpBom.ps1"
- Navigate to line number 74 and add the '_PartNumber' to the New-Object Cmdlet
$rawMaterial = New-Object PsObject -Property @{
'_PartNumber' = $file.'Raw Material Number'
'Part Number' = $file.'Raw Material Number'
'Name' = $file.'Raw Material Number'
'_Name' = $file.'Raw Material Number'
'Number' = $file.'Raw Material Number'
'_Number' = $file.'Raw Material Number'
'Bom_Number' = $file.'Raw Material Number'
'Bom_Quantity' = $file.'Raw Material Quantity'
'Bom_Position' = '1'
'Bom_PositionNumber' = '1'
} - Save the file and restart Vault.