You are currently viewing documentation for CompuTec ProcessForce 2.0, which is still supported.
We recommend upgrading to CompuTec ProcessForce 3.0, which is a plugin installed and managed through CompuTec AppEngine 3.0, built on .NET 8.
However, please note that CompuTec AppEngine 3.0 has a different architecture, and all CompuTec components, including the CompuTec ProcessForce 3.0 plugin, need to be updated together to ensure full compatibility.
Before starting your installation or upgrade process, we strongly recommend reviewing the CompuTec AppEngine 3.0 and CompuTec ProcessForce 3.0 documentation.
Example 4: Working with Manufacturing Orders
CompuTec ProcessForce API allows you to efficiently create and update manufacturing orders (MOs) within your system. This section provides step-by-step guidance on how to work with manufacturing orders using the API.
Adding New Manufacturing Order
-
Create IManufacturingOrder Object
IManufacturingOrder mor = company.CreatePFObject(CompuTec.ProcessForce.API.Core.ObjectTypes.ManufacturingOrder); -
Set which Bill of Material object you want to copy from:
//Set ItemCode if BillOfmaterial does not have a Revision
mor.U_ItemCode = "Chair01";
//or Get Code of BillOFMaterial
SAPbobsCOM.Recordset rec = company.SapCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
rec.DoQuery(string.Format("Select Code from [@CT_PF_OBOM] where U_ItemCode=N'{0} and U_Revision=N'{1}'", "Table01", "Rev01"));
mor.U_BOMCode = rec.Fields.Item(0).Value; -
Set the quantity and the required date:
mor.U_Quantity = 100;
mor.U_RequiredDate = DateTime.Today.AddDays(20); -
Add the document to the database:
mor.Add();
Updating Manufacturing Order
-
Create an IManufacturingOrder object:
IManufacturingOrder mor = company.CreatePFObject(CompuTec.ProcessForce.API.Core.ObjectTypes.ManufacturingOrder); -
Load from the database:
//parameter for GetBykey is DocEntry
mor.GetByKey("4"); -
Change the values you require in this object:
mor.U_PlannedStartDate = DateTime.Today.AddDays(3);
///Calculate MOR Times
mor.CalculateManufacturingTimes();
mor.U_Status = ManufacturingOrderStatus.Released;
///Set Accept Lower Quantity for all backflushItems
///
var itemsToChange = mor.Items.Where(p => p.U_IssueType == "B");
foreach (var item in itemsToChange)
{
item.U_AcptLowerQty = YesNoType.Yes;
} -
Call update method:
mor.Update()