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 2: Creating Simple Objects
To create and manage simple objects in CompuTec ProcessForce, follow these key principles:
- All CompuTec ProcessForce documents must be created using the factory method in IProcessForceCompanyObject called CreatePFObject.
- All objects contain methods such as Add, Update and GetByKey that can be used for adding, updating, or retrieving objects from the database.
- All document objects can be found in CompuTec.ProcessForce.API.Documents namespace.
The example below illustrates how to create a Resource Group object using CompuTec ProcessForce API:
try
{
//Create Resource Group Object
IResourceGroup resgrp = company.CreatePFObject(CompuTec.ProcessForce.API.Core.ObjectTypes.ResourceGroup);
resgrp.U_RscGrpCode = "GrpCode";
resgrp.U_RscGrpName = "GrpName";
if (resgrp.Add() == 0)
return true;
}
catch (UDOException e)
{
Console.WriteLine(string.Format("Error while adding { } object Message:{1}", e.ObjectCode, e.Message));
}
catch (Exception e)
{
Console.WriteLine(string.Format("Error while adding", e.Message));
}