Question

I am new to SAP business one. I have problem with sap business one screen painter forms. I want to validate forms for avoiding null values. I wrote this code:

If pVal.FormUID = "TRADING" And pVal.ItemUID = "1" And pVal.Before_Action = True And pVal.InnerEvent = False And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And (pVal.FormMode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Or pVal.FormMode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE) Then
    oEdit = oForm.Items.Item("10").Specific
    If oEdit.String = "" Then
        SBO_Application.StatusBar.SetText("Select Buyer Code", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
        BubbleEvent = False
        Exit Sub
    End If
End If

It works fine when I press ADD button but if I press close button of the right corner of the form it shows confirmation for save data. If I press "Yes" it still allows empty values to insert.

How can I solve this?

Était-ce utile?

La solution

Try using The SP_TransactionNotification Stored Procedure?

Here you will find some examples: http://scn.sap.com/people/lisa.mulchinock/blog/2009/05/22/the-sptransactionnotification-stored-procedure

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top