Click or drag to resize

clsImportWorkItemServicePlan Class

Info for table MPWorkItem: Service Plan for one customer service object or Equipment.

Access Table MARIProjektImportWorkItemServicePlan. See clsImportBase.eImportMode relative tables in MS-Access.

Use MPInterface.bImportServicePlan(clsImportWorkItemServicePlan, clsImportBaseeImportMode) to import.

Use clsImportWorkItemServicePlanPosition to import positions to the service plan (Spare parts, services).

Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportWorkItemServicePlan

Namespace:  MARIInterface
Assembly:  MARIInterface (in MARIInterface.dll) Version: 8.0.0.100
Syntax
public class clsImportWorkItemServicePlan : clsImportBase

The clsImportWorkItemServicePlan type exposes the following members.

Constructors
  NameDescription
Public methodclsImportWorkItemServicePlan
Initializes a new instance of the clsImportWorkItemServicePlan class
Top
Methods
  NameDescription
Public methodGetListUserDefinedFields
Returns the user defined field definition for all dimension "WorkItem: Service Plan Template, Service Plan, Service Task, etc.". The fields have to be defined directly in MARIProject.
(Overrides clsImportBaseGetListUserDefinedFields(MPInterface).)
Top
Fields
  NameDescription
Public fieldCheckList
CheckList (int)
Public fieldCompanyID
Company ID. Link to the logical link to the SBO Database(Schema)
Public fieldContractID
Link to the internal contract to fullfill the scheduled service
Public fieldContractPosition

This field will default the contract position link for new spareparts in the service plan.

  • 0 = new positions will default to items at cost.
  • >100000 Pointing to a fixed price positions: Defaults new positions to be items at fixed price linked to the selected fixed price position in this property.

Public fieldCurrency
Currency (NVARCHAR 3)
Public fieldCycleType
Cycle Type. When a ServicePlanTemplate is linked and this value=None, the value is copied from the template.
Public fieldCycleValue
Cycle Value
Public fieldEndDate
WorkItemEnd End of the plan
Public fieldExchangeRate
Exchange Rate (decimal)
Public fieldHandlingOnMovementMode
Public fieldMatchcode
Matchcode (NVARCHAR 50)
Public fieldPhaseID
Phase of the project with planning version = 3
Public fieldProject
Link to an internal project with contract to fullfill the scheduled service
Public fieldScheduleType
Handling definition to create the plan dates for a service plan. See eScheduleType. When a ServicePlanTemplate is linked and this value=None, the value is copied from the template.
Public fieldServiceObject
Key of the customer service object or the equipment master
Public fieldServiceObjectType
ServiceObjectType: Link to CSO or Equipment
Public fieldServiceplanID
Serviceplan ID: Internal number of the service plan. Will be created in the import. Can be 0. For access this number should be <100000 to link the positions
Public fieldServicePlanTemplate
Link to the service plan templates. The template defines the standard cylce and the standard checklist.
Public fieldStartDate
StartDate start of the plan
Top
Remarks
Examples
Create a service plan for one given equiment
string sErrordetails;

try {
    //Create a service plan for one equipment
    clsImportWorkItemServicePlan NewServicePlan = new clsImportWorkItemServicePlan();
    NewServicePlan.Matchcode = "DTW Service Plan for Equpment";
    NewServicePlan.ServiceObjectType = clsImportWorkItemServicePlan.eServiceObjectType.Equipment;
    NewServicePlan.ServiceObject = "E110000"; // In this case the Id of the EquipmentMaster: SELECT EquipmentCode FROM MARIEquipmentMaster
    NewServicePlan.StartDate = new DateTime(2015, 1, 1);
    NewServicePlan.EndDate = new DateTime(2018, 12, 31);
    NewServicePlan.ServicePlanTemplate = 102055; // SELECT WorkItemID FROM MARIWorkItem WHERE WorkItemType=378 ... Additional conditions based on the "Used In" definition of the template
    NewServicePlan.CompanyID = 1;

    //Optional orverwrite the cycle type for this specific plan
    NewServicePlan.CycleType = clsImportWorkItemServicePlan.eCycleType.Quarterly;

    //Optional Link to a service project with contract and an internal contract
    NewServicePlan.Project = "P100028";
    NewServicePlan.ContractID = 102056; //SELECT ContractID FROM MARIContract WHERE ProjectNumber='P100028'
    NewServicePlan.ContractPosition = 0; // New positions in the sevice plan will be default to item at cost.

    if (oMPInterface.bImportServicePlan(NewServicePlan, clsImportBase.eImportMode.ValidateAndImport)) {
        sErrordetails = "";
        return;
    }

    sErrordetails = oMPInterface.oErrors.PrintErrors(true);
    LogFail(sErrordetails);
    return;

} catch (Exception ex) {
    sErrordetails = ex.Message;
    LogFail(sErrordetails);
    return;
}
See Also