title: Setting the value of an Enum field in a temporary record
body: <p>Total newbie in AL here; I'm experimenting with automated testing in Dynamics BC for a new deployment. As a very basic test, I'd like to simply create a new Item record in the Cronus test database and validate each field. I'm running into trouble when I try to select the value for an enum field. Here's the code I'm using:</p>
  <pre><code>Procedure AddGoodItem()
  // [Given] Good item data
  var
      recItem: Record Item Temporary; 
  Begin
      recItem.&quot;Description&quot; := 'zzzz';
      recItem.validate(&quot;Description&quot;);
      recItem.Type := recItem.Type::Inventory;
      recItem.Validate(Type);
      recItem.&quot;Base Unit of Measure&quot; := 'EA';
      recItem.Validate(&quot;Base Unit of Measure&quot;);
      recItem.&quot;Item Category Code&quot; := 'FURNITURE';
      recItem.validate(&quot;Item Category Code&quot;);
  End;
  </code></pre>
  <p>When I run this in Cronus, I get the error:</p>
  <pre><code>You cannot change the Type field on Item  because at least one Item Journal Line exists for this item.
  </code></pre>
  <p>If I comment the Type lines out, the process runs successfully.</p>
  <p>Given that this is a temporary record, it shouldn't have any Item Journal Lines, should it? What am I missing?</p>