You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Field Is Required while calling DoSaveNow()

2 replies [Last post]
Guest's picture
Guest

Why OT_ESS.DATE is stated empty while calling DoSaveNow() althought it already has a value?

Here is the code in the submit button

Local Rowset &LocalRowOT;
&LocalRowOT = GetLevel0()(1).GetRowset(Scroll.OT_ESS);

For &i = ActiveRowCount(Scroll.OT_ESS) To 1 Step - 1
  
   If All(&LocalRowOT(&i).OT_ESS.EMP_RMK.Value) Then
      &LocalRowOT(&i).OT_ESS.STATUS.Value = "SUB";
   End-If;
   If All(&LocalRowOT(&i).OT_ESS.CODE.Value, &LocalRowOT(&i).OT_ESS.DATE.Value, &LocalRowOT(&i).OT_ESS.EMP_RMK.Value) Then
      &LocalRowOT(&i).OT_ESS.DATE.Enabled = False;
      &LocalRowOT(&i).OT_ESS.EMP_RMK.Enabled = False;
   End-If;
     
   DoSaveNow();
      
End-For;

I got this error messsage after click the SUBMIT_BTN
Field Is Required: OT_ESS - DATE

I try to display the value so add the code with message boxes:

Local Rowset &LocalRowOT;
&LocalRowOT = GetLevel0()(1).GetRowset(Scroll.OT_ESS);

For &i = ActiveRowCount(Scroll.OT_ESS) To 1 Step - 1
   MessageBox(0, "", 0, 0, "&i is " | &i | " &LocalRowOT(&i).OT_ESS.DATE is " | &LocalRowOT(&i).OT_ESS.DATE | " &LocalRowOT(&i).OT_ESS.DATE.Value is " | &LocalRowOT(&i).OT_ESS.DATE.Value);
End-For;

For &i = ActiveRowCount(Scroll.OT_ESS) To 1 Step - 1
  
   If All(&LocalRowOT(&i).OT_ESS.EMP_RMK.Value) Then
      &LocalRowOT(&i).OT_ESS.STATUS.Value = "SUB";
   End-If;
   If All(&LocalRowOT(&i).OT_ESS.CODE.Value, &LocalRowOT(&i).OT_ESS.DATE.Value, &LocalRowOT(&i).OT_ESS.EMP_RMK.Value) Then
      &LocalRowOT(&i).OT_ESS.DATE.Enabled = False;
      &LocalRowOT(&i).OT_ESS.EMP_RMK.Enabled = False;
   End-If;

   MessageBox(0, "", 0, 0, "before save : OT_ESS.DATE is " | OT_ESS.DATE | " and OT_ESS.DATE.Value is " | OT_ESS.DATE.Value);
     
   DoSaveNow();
      
End-For;

The first Message box
i is 1 &LocalRowOT(&i).OT_ESS.DATE is Field &LocalRowOT(&i).OT_ESS.DATE.Value is 2010-06-10

The second Message box
before save : OT_ESS.DATE is and OT_ESS.DATE.Value is

the field DATE already has a value (displayed in the message box). But why it generates error while calling DoSaveNow() ?

Lepa's picture
User offline. Last seen 5 days 11 hours ago. Offline
Joined: 06/23/2008
Posts: 570
Re: Field Is Required while calling DoSaveNow()

why do you have the DoSaveNow(); inside of your "for" loop? Can you put it outside so the the save is not done until you exit the loop?

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

Guest's picture
Guest (not verified)
Re: Field Is Required while calling DoSaveNow()

I already change the DoSaveNow(); after the loop but still got the error message Field Is Required: OT_ESS - DATE

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The question below is to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.