Thursday, May 23, 2013

RowDelete Processing Stops mysteriously

Last week I was investigating along with my colleague on an issue in Position Information in Job Data Component, we came across a strange scenario.

In order to fix the issue we had added a piece of code in RowDelete event in one of the fields of JOB  record (Lets call it FIELDXYZ in the rest of this post). Interestingly our code was not triggered even if the rows are deleted from the scroll.

Newly added code in JOB.FIELDXYZ.RowDelete looks like this.

 
If Condition1 And Condition2 And Condition3 Then
    Do THIS;
End-if;

Initially we thought some of the conditions in the "IF" construct are not met and that is why our code was not triggered. As a next step we issued a MessageBox/Winmessage at the beginning of the code (outside IF) to confirm if the RowDelete event itself is executed or not. Result of that trial confirmed that the RowDelete event for the Field was never executed.

So what went wrong? We continued our analysis, went one step ahead and added a MessageBox/Winmessage in the RowDelete event of the field just above the FIELDXYZ. Again this code was also not executed.

Next time MessageBox/Winmessage statement was added to the last RowDelete code(Lets call it FIELDLAST RowDelete code) before FIELDXYZ. This time the code was executed and the MessageBox was popped up.

On analyzing the existing code in the last RowDelete event, we found that the issue happenes when a warning was triggered in RowDelete event. If a warning is issued RowDelete processing stops  no matter what button (OK or Cancel) the user clicks.

We haven't yet uncovered if this is PeopleTools bug or desired functionality. I will update you guys once I have a confirmation.

No comments: