RE:[peopletools-l] Preventing Row Insertion when 'Save' is Clicked

Reply from Curtis Melnick on Jul 27 at 3:26 PM
Typically an un-check check-box has a value of "N".

So, along that train of thought:

Local record &RecordToValidate = GetLevel0()(1).<blah, blah, blah>);

If &RecordToValidate.CHECKBOX1.VALUE = "N" and
&RecordToValidate.CHECKBOX2.VALUE = "N" and
&RecordToValidate.CHECKBOX3.VALUE = "N" then
Local string &ErrMsg = "Message 30000, 110 not found at MYRECORD.MYFIELD.SaveEdit";
Error MsgGet(30000, 110, &ErrMsg);
End-if;

&RecordToValidate = Null;

---------------Original Message---------------
From: Ken Duncan
Sent: Friday, July 27, 2012 3:09 PM
Subject: Preventing Row Insertion when 'Save' is Clicked

From looking in the doc, it appears that I cannot call Error() from SavePreChange on the component, but I can call it in SaveEdit. Given a page with three checkboxes for unrelated items, I want to prevent the user saving a record if none of these checkboxes have been clicked. Should this give me what I want?

rec1.field3.SaveEdit event:

If None(Page1.pagefield1) AND Used for rec1.field1
None(Page1.pagefield2) AND Used for rec1.field2
None(Page1.pagefield3) Used for rec1.field3
THEN
Error(30000,110, "Message Not Found");
End-If;

My issue is that if none of the checkboxes are selected but the Save button is clicked, will the SaveEdit event run for each page field? Does this require each page field to have a name or is it sufficient to reference rec.field values in the record that is to be saved?

Or, is there a different/better way to verify that at least one choice has been made on a page? Thanks.

Ken

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2012 Toolbox.com and message author.
Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
Curtis Melnick  
Senior PeopleSoft Developer/architect
achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Become a blogger at Toolbox.com and share your expertise with the community. Start today.

_.____.__

No comments:

Post a Comment