cancel
Showing results for 
Search instead for 
Did you mean: 

Action_Success B1 2004, B12005

Former Member
0 Kudos

Hi all!

Some idea about this?

In B1 2004A when I saved a customer order, Action_Success was TRUE only after the saving on B1 Company DB. Now (with B1 2005A SP:00 PL:07) Action_Success = TRUE immediately after the click on Saving button (pVal.ItemUID = 1).

I need to start my add-on only after saving customer order on B1 Company DB, also in B1 2005!

This is my VB.NET code:

Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent

If pVal.FormType = "139" Then

Select Case pVal.EventType

Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD

...

Case SAPbouiCOM.BoEventTypes.et_CLICK

...

End Select

If pVal.Action_Success = True And pVal.ItemUID = 1 And (pVal.FormMode = 2 Or pVal.FormMode = 3) Then

....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

try this:

Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent

If pVal.FormType = "139" Then

Select Case pVal.EventType

Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD

...

Case SAPbouiCOM.BoEventTypes.et_CLICK

...

End Select

If pVal.Action_Success = True And pVal.ItemUID = 1 And (pVal.FormMode = 2 Or pVal.FormMode = 3) Then

msgBox("Action_Success: " + CStr(Action_Success))

End If

End Sub

In is my code.

In B1 2004 messagebox appears after saving customer order and after clearing form.

In B1 2005 messagebox appears soon after clik save button.

Former Member
0 Kudos

Hi,

I try your code whit this change:

MsgBox("Action_Success: " & CStr(pVal.Action_Success) & " " & pVal.EventType)

In SBO 2005 PL7:

I have two message, one for event 6 (et_CLICK) and other for event 1 (et_ITEM_PRESSED).

In SBO 2004:

I have only one message for event et_ITEM_PRESSED.

Is the diference between two versions, I think that you need to include this validation, The correct event is et_ITEM_PRESSED.

Best Regards.

Answers (5)

Answers (5)

Former Member
0 Kudos

Thanks David! So it runs, even if in 2004A there's some difference in add-on managing events, I beleve!

Former Member
0 Kudos

Hi David,

I know the ActionSuccess and BeforeAction are right, that is when one is true the other is false, but the difference between B1 20004A and B1 2005A is when ActionSuccess is set to true.

In B1 2004 ActionSuccess was set to true after:

- saving customer order (for istance) in B1,

- B1 cleared the form

Only at that moment ActionSuccess = True and the control returned to my add-on.

In B1 2005 ActionSuccess is set to true just after the click on save bottom.

Former Member
0 Kudos

Hi,

And in SBO 2005 too if you use the ITEM_PRESSED event, what event use for this operation?

Best regards.

Former Member
0 Kudos

Hi all,

I try whit this code:

If pVal.FormTypeEx = "139" And pVal.ItemUID = "1" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED Then

apl.MessageBox("Before: " & pVal.BeforeAction & " Action: " & pVal.ActionSuccess)

End If

And the system show two mesage:

Before: True Action: False

Before: False Action: True

I use SBO 2005 PL7, and I think that the system is OK.

Try to add in your conditions: BeforeAction = False.

Best Regards.

PD.- I use EventSpy 2004 and have acceptable results.

Former Member
0 Kudos

Hi Adele, I just tried... but nothing

Former Member
0 Kudos

Hi Stefano,

Dont really know much about 2005 yet, but have you got the eventspy tool avaiable? That will show you which events are fired, and why you aren´t getting what you need.

Hope helps,

Ibai Peñ

Former Member
0 Kudos

Hi Ibai,

EventSpy is not in 2005

Adele

Former Member
0 Kudos

Hi Stefano,

Try using ActionSuccess instead of Action_Success. Action_Success is deprecated in 2004. Not sure if it will make any difference, but worth a try!

Hope it helps,

Adele