cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in SAP B1PL 42 on validate events and exiting functions

Former Member
0 Kudos

I've recently tested an upgrade to PL 42. There seems to be an issue when trying to exit a function or trying to set return false.

Here is a sample code of what i use to accomplish in previous patches.

...

Case SAPboiuCOM.BoEventTypes.et_VALIDATE
       Select Case pVal.ItemUID
             Case "matPay"
                    If pval.InnerEvent Then
                         do nothing
                     else
                         Dim oMatrix as SAPbouiCOM.Matrix = oForm.Items.item(pVal.ItemUID).Specific
                         Select Case pVal.ColUID
                                Case "RegHours" : if sglRegHours = oMatrix.Columns.Item(pVal.ColUID).Cells.Item(CInt(val(pval.Row)).Specific.Value then Return False
                         End Select

No matter what I try here, Return False, Exit Function, it does not work. It keeps executing the rest of the code. And yes, the statement gets executed.

Any one else has found something similar to this odd behavior ?

any comments or suggestions would be greatly appreciated

Edited by: Neftali Figueroa on Jan 31, 2008 10:58 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Neftali Figueroa

¿Can you have tried with Exit Select?

The other option you have is replace the case for if.

José Moreno

Former Member
0 Kudos

Hi

That too. I even tried controlling the process with a boolean variable, and after it executes the statement blnValueChanged = False

it stays True.

Never seen anything like this in my developer life! The funny part is that it only occurs with cells that have values other than zero.

But it makes no sense at all since when I validate for equality the system detects no inequality and executes the statement correctly.

Answers (2)

Answers (2)

Former Member
0 Kudos

I found a workaround but there's seems to be a nasty bug between .NET and SAP B1 PL 42

Former Member
0 Kudos

Well

I found a workaround for this odd problem. What I did was ... since the evaluation part of the code (if statement) was getting executed right, i changed the statement like this

blnValueEdited = (sglRegHours <> Csgl(oMatrix.Columns.Item(pVal.ColUID).Cells.Item(CInt(val(pval.Row)).Specific.Value ))

and then evaluate the blnValueEdited for true