Note: This page is currently incomplete, it is a work in progress. As more content is added it will become a part of the online documentation.

Until a parser/checker is created to compare your PRTDF file (and includes) with standard fields, there is every chance you will find two different sorts of error messages, typically as you try and load up Preactor's planning board:

(a) if a standard PRTDF field was removed from your PRTDF file, as you load the planning board, POM will generate an error like this:

<image to be added>

The error message is "Runtime Error in Preactor.ObjectModel", and
... "Can not find a field with a classification of 'TOTAL PROCESS TIME' in format: Orders ...

To correct this you should restore the original classification field back into your PRTDF file. In this example it would be something like this:

Total Process Time, 0, DURATION,
            TOTAL PROCESS TIME
            HIDDEN
            READ ONLY:

You need to exit Preactor and re-run it, to have it "see" changes to the PRTDF file, though when you do run it again for the first time, you will get a message like this:

As Preactor re-creates the missing changes in SQL corresponding to the re-added field.

(b) If you have added a custom field into your PRTDF file but not yet included this in your application, you will get a different issue. You will not yet have a property defined on a particular object.

For example, suppose you have these custom entries in the Products section of your PRTDF file:

  Allowed Over Weekend,"No",STRING,
      FREE FORMAT(3)
      INHERIT FROM PARENT
      DIALOG ONLY:
   Allowed Overnight,"No",STRING,
      FREE FORMAT(3)
      INHERIT FROM PARENT
      DIALOG ONLY:

Normally we'd create a folder Inside our application, called FrameworkEntities, and then inside this create  Product.cs and Product.Field.cs inside this.

In this example a further custom ,calculated field QuantityPerMinute is also added. This is the application side copy of Product.cs:

using Preactor;
using Preactor.ObjectModel;
 
namespace MyApplication.FrameworkEntities
{
   public sealed partial class Product : Preactor.ObjectModel.BaseTypes.Product
   {
       public double QuantityPerMinute { get; private set; }
 
       public override void Refresh()
       {
           base.Refresh();
       }
 
       public Product(PrimaryKey id, PreactorObjectModel pom) : base(id, pom)
       {
           Refresh();
           QuantityPerMinute = this.QuantityPerHour/60;
       }

       public override string ToString()
       {
           return string.Format("Type: Product, Format Name: {0}, PK: {1}", FormatName, Id.Value);
       }
   }
}

And this is (a part of) the Product.Fields.cs file:

using Preactor.ObjectModel.Attributes;
using Preactor.ObjectModel.Entities;
 
namespace MyApplication.FrameworkEntities
{
   public sealed partial class Product
   {
       [PreactorField("Allowed Over Weekend", FieldDeclarationType.FieldName)]
       public string AllowOverWeekend
       {
           get { return (string)GetValue("AllowOverWeekend"); }
           set { SetValue("AllowOverWeekend", value); }
       } 

       [PreactorField("Allowed Overnight", FieldDeclarationType.FieldName)]
       public string AllowOvernight
       {
           get { return (string)GetValue("AllowOvernight"); }
           set { SetValue("AllowOvernight", value); }
       }

. . . . etc 

 

 

 

Last edited Jun 19, 2012 at 8:06 AM by Robert_Dyball, version 4

Comments

No comments yet.