cancel
Showing results for 
Search instead for 
Did you mean: 

Problem capturing the correct event using B1DE

Former Member
0 Kudos

Hi

I am working on 2005a SP01 PL 29. I am using B1DE and have added a hook onto when the ok button is pressed on the delivery note form so I can perform some extra processing.

I am looking for the click event and did not tick the before box. The problem I have is that it seems to be running my code before SAP has started processing the form, as after my code finishes SAP displays a message about not being able to change the document after you have added it.

Any ideas how I can hook after this please ?

Thanks

Regards Andy

Accepted Solutions (0)

Answers (2)

Answers (2)

MNiebergall
Explorer
0 Kudos

Hi Andy,

as Trinidad points out, try to use the Eventviewer-Tool. The order, the events are fired, if you click the item "1" are:

1. Click (before)

2. Click (after)

3. itemPressed (before)

4. dataAdd (before)

5. dataAdd (after)

6. itemPressed (after)

So, if you use the itemPressed event instead of itemclick, you are able to catch the event after SAP adds your delivery note. You cannot do that with the Click-Event.

hope it helps,

Markus

Former Member
0 Kudos

Hi Markus and Trinidad

Thanks for the help, I will try the other events and see where that gets me.

Have a good day !

Regards Andy

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Paul,

I don't know whether I understood your problem but I'll try to help you.

When you create the listener for the click event with B1DE you haven't tick the before box, then you have chosen to receive the event in the "AFTER" action. If you tick the before box then you will receive the event in the before action.

Have you tried to have a look to your code listening the click event? Before the function declaration you can see the name of the event and the before or after tag. How is the listener declared?

You cannot change a document in the after event if the document cannot be modified once created. You have to listen the before event and modify what you need in there.

Hope it helps

Trinidad.

MNiebergall
Explorer
0 Kudos

Hi Paul,

try to use the itemPRESSED event instead of itemCLICK.

regards,

Markus

Former Member
0 Kudos

Hi Trinidad

This is the code I am using -


        <B1Listener(BoEventTypes.et_CLICK, false)>  _
        Public Overridable Sub OnAfterClick(ByVal pVal As ItemEvent)
            Dim ActionSuccess As Boolean = pVal.ActionSuccess
            Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
            Dim item As Item = form.Items.Item("1")
            Dim button As Button = CType(item.Specific, Button)
            Dim matrix As Matrix = form.Items.Item("38").Specific
            Dim lc As Integer
            'ADD YOUR ACTION CODE HERE ...
            For lc = 1 To matrix.RowCount - 1
                'B1Connections.theAppl.MessageBox(matrix.Columns.Item("1").Cells.Item(lc).Specific.string)
                'Debug.Print(matrix.Columns.Item("1").Cells.Item(lc).Specific.string)
                Beep()
            Next

        End Sub

I want to post some extra journals but only after SAP has finished it;s current operation

I hope that makes sense

Regards Andy

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Paul,

I don't see what is your problem.

You can use the ItemPressed or the FormDataEvent instead.

If you want to see the events that are sent by B1 for each user action and at which moment you can use the EventLogger tool, you can download it from the SDN SDK Tools page.

Regards

Trinidad.