Sample.TransferERPBOMViaFileTab
The “ERP BOM” tab from this sample script allows the designer to select a file in the Vault Client and immediately see if a BOM already exists in the ERP system.
If it does, all the position numbers, material numbers, quantities, and other relevant BOM row details are displayed live from the ERP system.
Using the BOM Window it is possible to automatically generate and update all required materials and BOMs in the ERP system.
Requirements
The event script is designed to be used with the sample ERP Plugin of powerGateServer:
A connection to the “BomService” and “MaterialService” is required. The Sample.ConnectToPowerGateServer script ensures that Vault is connected to the OData service before any operations are performed by this tab
An entity set named “Boms” is expected as well as the entityset “BomItems”, “Materials” and “MaterialDescriptions”
To provide additional information a pre-configured set of data for UnitOfMeasures and MaterialTypes are required. The Sample.SyncERPTabConfiguration script ensures that a default configuration is uploaded to Vault.
Vault files are uniquely assigned to an ERP BOM via their material number stored in the Vault property “Part Number” and the ERP field “ParentNumber”
Individual BOM rows are also identified by the material number, but their position in the CAD BOM and the ERP BOM “Position” must also match
Testing
The script can be tested by doing the following steps on your test-environment:
Install powerGateServer which comes by default with its sample ERP plugin and check that the service is running
Open the Vault Client and log in to your TestVault
Navigate to a file and select it
Click on the tab with the name “ERP BOM”
Since no BOM with the “Part Number” of the selected file exists in the ERP plugin of powerGateServer, a new one can be created.
To do this, click on “Transfer BOM to ERP”:The BOM Window opens and the complete CAD-BOM is displayed.
Use the respective Check- and Transfer buttons in the “Items” tab to first create or update all the required Items in ERP
Click the Check- and Transfer buttons in the “BOM” tab.
The BOMs have now been successfully generated in the ERP system and the BOM Window can be closed.
The position number, material number, quantity, and other relevant information are displayed for all rows in the newly created ERP BOM:
Disabling the script
By default, the script enables the Vault “ERP BOM” tab for files.
If you work exclusively with Vault Items, or if you do not use this tab, the file %PROGRAMDATA%\coolOrange\powerEvents\Events\Sample.TransferERPBOMViaFileTab.ps1 can be moved to the directory %PROGRAMDATA%\coolOrange\powerEvents\Events\Disabled.