Skip to Content
author's profile photo Former Member
Former Member

Bug in SAP B1PL 42 on validate events and exiting functions

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 04:34 PM

    Hi Neftali Figueroa

    ¿Can you have tried with Exit Select?

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

    José Moreno

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 05:54 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 05:55 PM

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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.