title: duplicate date by every row nav 2009
body: <p>I have a GetDates function like this:</p>
  
  <pre><code>GetDates(BOM : Record "BOM Component";VAR StartDate : Date;VAR EndDate : Date)
  // Called from OnAfterGetRecord in form 36
  
  IF BOM.GET("Parent Item No.",BOM."Line No.") THEN BEGIN
    //MESSAGE(FORMAT(BeginDate));
    StartDate := BeginDate;
    EndDate := EndDate;
  END
  </code></pre>
  
  <p>And I hava a from 36 where I call the function:</p>
  
  <pre><code>//ItemAdditionBeginDate := 0D;
  ItemAdditionBeginDate := ItemAdditionHallo.BeginDate;
  //ItemAdditionEndDate := 0D;
  ItemAdditionEndDate := ItemAdditionHallo.EndDate;
  
  ItemAddition.GetDates(Rec,ItemAdditionBeginDate,ItemAdditionEndDate);
  ItemAddition.GetRegelkorting(salesLine, ItemAddition.Regelkorting);
  </code></pre>
  
  <p>But the problem is dat every time you add a new date in the form it copies the value to the other row, like this:</p>
  
  <p><a href="https://i.stack.imgur.com/vlLIT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vlLIT.png" alt="enter image description here"></a></p>
  
  <p>So how to solve that the dates are not been copied.</p>
  
  <p>Thank you</p>
  
  <p>I declare getDates in TABLE 50012:</p>
  
  <pre><code>GetDates(BOM : Record "BOM Component";VAR StartDate : Date;VAR EndDate : Date)
  // Called from OnAfterGetRecord in form 36
  
  IF BOM.GET("Parent Item No.",BOM."Line No.") THEN BEGIN
    //MESSAGE(FORMAT(BeginDate));
    StartDate := BeginDate;
    EndDate := EndDate;
  END
  </code></pre>
  
  <p>And this is for setDates:</p>
  
  <pre><code>SetDates(BOM : Record "BOM Component";VAR StartDate : Date;VAR EndDate : Date)
  // Called from OnValidate of start and end dates in form 36
  BOM.INIT;
  "Item No." := BOM."Line No.";
  "Parent Item No." := BOM."Parent Item No.";
  //Stuklijst."Line No." := BOM."Line No.";
  StartDate := StartDate;
  EndDate := EndDate;
  
  
  IF NOT MODIFY THEN 
    INSERT;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/da3Fi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/da3Fi.png" alt="enter image description here"></a></p>
  
  <p>oke, I have it now like this:</p>
  
  <pre><code>SetDates(BOM : Record "BOM Component";VAR startDateparm : Date;VAR EndDateparam : Date)
  // OnValidate of start and end dates in form 36
  
  BOM.INIT;
  "Item No."             := BOM."Line No.";
  "Parent Item No."      := BOM."Parent Item No.";
  BeginDate              := startDateparm;
  EndDate                := EndDateparam;
  
  IF NOT MODIFY THEN 
    INSERT;
  </code></pre>
  
  <p>but the dates are still copying from the previous record. If I go to a other record:</p>
  
  <p>See image:
  <a href="https://i.stack.imgur.com/ypg0q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ypg0q.png" alt="enter image description here"></a></p>