cancel
Showing results for 
Search instead for 
Did you mean: 

Track Add button event--User setup form after add button action

Former Member
0 Kudos
65

Hi friend

i need to do an action after the add button.

In User setup form after add button action, if the action is success i need to insert some values to a user table. how can i do this.how can i track the action is success or fail on code

thnaks

View Entire Topic
Nussi
Active Contributor
0 Kudos

Hi Muna,

iam working on something similar at the moment, thats why i can provide you this c# snippet.


if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED && pVal.ItemUID == "1" && 
    pVal.BeforeAction == false && pVal.ActionSuccess == true && pVal.FormType == 20700)
{
  // Successfull added

}

lg David

Former Member
0 Kudos

Thanks David.

but there is one problem. i need the user code value. but after addition done the text field is blank. is there any option to gt the user code

Nussi
Active Contributor
0 Kudos

Hi Muna,

ok - than you also need this.

create a global variable:


string sUserCode = "";

than include this c# code in your itemevent:


if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED && pVal.ItemUID == "1" &&
   pVal.BeforeAction == true && pVal.FormType == 20700)
{
    oForm = SBO_Application.Forms.Item(FormUID);
    sUserCode = ((SAPbouiCOM.EditText)(oForm.Items.Item("13").Specific)).Value;
}

lg David

Former Member
0 Kudos

or use

SBO_Application.Company.UserName()

This will return a string specifying the username that was used to log-on to the SAP Business One application.

Nussi
Active Contributor
0 Kudos

Hi Petr,

i don't think it's useful - he wat to catch the NEW created user !

that's why i provided him this code.

lg

Former Member
0 Kudos

you are true, I thought that its user defined table and not user table in system... Sorry

Former Member
0 Kudos

Thanks peter

Nussi
Active Contributor
0 Kudos

sometimes i don't get it.

looks like he was looking for something else - for what are we helping sometimes

when the thread title is wrong ?

Former Member
0 Kudos

Sorry David Nussböck .Your answer is correct thanks

Edited by: Muna on Jun 19, 2008 12:40 PM

Nussi
Active Contributor
0 Kudos

Muna

you are always welcome

lg