Field Is Required while calling DoSaveNow()
Forum » Forum / Help » Field Is Required while calling DoSaveNow()
Started by: mi jo (guest)
On: 1276778170|%e %b %Y, %H:%M %Z|agohover
Number of posts: 4
rss icon RSS: New posts
Summary:
Field Is Required while calling DoSaveNow() Why OT_ESS.DATE is stated empty while calling DoSaveNow() althought it already has a value?
Field Is Required while calling DoSaveNow()
mi jo (guest) 1276778170|%e %b %Y, %H:%M %Z|agohover

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() ?

Reply  |  Options
Unfold Field Is Required while calling DoSaveNow() by mi jo (guest), 1276778170|%e %b %Y, %H:%M %Z|agohover
Re: Field Is Required while calling DoSaveNow()
Anonymous (guest) 1277632212|%e %b %Y, %H:%M %Z|agohover

Does it work if you check for a value of OT_ESS.DATE before calling DoSaveNow() ? E.g.

If All(&LocalRowOT(&i).OT_ESS.DATE.Value) Then
   DoSaveNow();
End-If;
Reply  |  Options
Unfold Re: Field Is Required while calling DoSaveNow() by Anonymous (guest), 1277632212|%e %b %Y, %H:%M %Z|agohover
Re: Field Is Required while calling DoSaveNow()
mi jo (guest) 1283479072|%e %b %Y, %H:%M %Z|agohover

I've change the code to
If All(&LocalRowOT(&i).OT_ESS.DATE.Value) Then
DoSaveNow();
End-If;

but still got the error

Unfold Re: Field Is Required while calling DoSaveNow() by mi jo (guest), 1283479072|%e %b %Y, %H:%M %Z|agohover
Re: Field Is Required while calling DoSaveNow()
PrajPraj 1283480705|%e %b %Y, %H:%M %Z|agohover

Looks like maybe the OT_ESS.DATE field in the second row of the Scroll.OT_ESS? On the page itself, does the second row in the scroll/grid have a value for the DATE field?

Reply  |  Options
Unfold Re: Field Is Required while calling DoSaveNow() by PrajPraj, 1283480705|%e %b %Y, %H:%M %Z|agohover
New Post
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License