Friday, 28 August 2015

Checkbox with Error - PeopleCode Friday #1

This is the first in what I hope to be a regular Friday feature on PeopleCode.  I hope you find these useful.

Today's puzzle came from a friend of mine David Jubber at BMI Healthcare - thanks David !

QUESTION:  What happens if you tick ON a check box but during the FieldEdit event an ERROR is thrown?

OPTIONS:  Would you expect it to display the error message and...

   (A) leave the check box ticked ON, or
   (B) leave the check box unticked

Figure 1 shows the PeopleCode behind the check box and I'm simply throwing an Error if the user is gsmith.
Fig 1. Code to validate the change of CheckBox


Fig 2. Error Message after check box ticked ON

ANSWER:  The answer is OPTION (A).  The tick is left ON even though the Edit (validation) fails the Edit test.

Is this what you were expecting?  It might not behave quite as you wanted.  After all ... the edit failed.... so clearly I shouldn't be allowed to tick the check box on.  So, let's try and code around this behaviour and undo the tick action with what seems like some obvious PeopleCode.  See Fig 3.

Fig 3.  Code to revert the tick action
However, as you can see from Fig. 4 it's not possible to make change to the current field in FieldEdit.  (you can read more on processing sequence in PeopleBooks ).

Fig 4.  Illegal operation to set current field value during FieldEdit

Workarounds

One possible solution might be to move the code from FieldEdit to FieldChange, use a MessageBox function instead of ERROR and handle the "exit error" from the event manually.   FieldChange allows the setting of current field and can therefore reset the checkbox value to OFF.

Interestingly, Radio Buttons do not behave the same.  This next example uses the same field and the same code but the radio button change is reset to it's original value if the Edit fails.

Fig 5. Radio buttons behave as OPTION (B)
  • Which one do you prefer?  
  • I wonder why they behave differently?  
  • Can anyone suggest another solution to revert the check box on ERROR?
  • Why doesn't the checkbox get highlighted red?
NOTE: I'm not responsible for the label typo on field object PTCHKBX.  That's a delivered PeopleTools object.  :-)


Tuesday, 18 August 2015

UKOUG Apps 2015 Conference



Two days of high quality PeopleSoft presentations and great networking opportunities sum up the annual UKOUG APPS15 conference at the ICC Birmingham on Tuesday 8th and Wednesday 9th December.

Check out the Agenda here.   Great to have Jeff Robbins (Senior Director, PeopleTools Strategy, Oracle) join us to give us first hand insight into the latest PeopleSoft software and upcoming enhancements.

On Wednesday I'll be presenting on PeopleSoft Fluid, Classic or Both: A decision for Every Customer

PeopleSoft 9.2 on PeopleTools 8.54 made available the Fluid user interface aimed at self service, casual and executive users. Many Classic self service components now have an alternative Fluid based component giving customers a choice of running Classic or Fluid versions. However, with choice comes the need to make decisions. This presentation explains what these choices are and some real world discussion on what decisions need to be made and offers some help in making them.

NOTE:  The APPS15 conference runs over 3 days but there is only PeopleSoft content on 2 days.  This is a great opportunity to meet PeopleSoft customers, partners and Oracle staff.  I hope to see you there.