on 08-25-2012 12:45 PM
HI..
See the image..
This is my Add on... Just like a incomming payment
Normally if i press third radio button (others) in sap b1 incomming payment wizard
header level edit boxes will be become visible=false
and then in matrix first row at particular column Glaccount cfl will be loaded ...
The same thing i had done..
Normally if i put the cfl in the program i am calling the cfl at the time of form loading
Every time i am calling like this way
and then item event saparate code i am writing..
Dim oedit11 As SAPbouiCOM.EditText
omatrix = oform.Items.Item("17").Specific
' omatrix.AddRow(1)
oedit11 = omatrix.Columns.Item("V_7").Cells.Item(1).Specific
cflacc1()
oedit.ChooseFromListUID = "CFL3"
oedit.ChooseFromListAlias = "Acctcode"
' oedit.ChooseFromListAlias = "Cardcode"
but this time i had written exactly at item event because the action should be done only
if i check third radio button but not form loading...
So, i had used the below code (see the bold colour) exactly here i got the above error..
May i know what is mistake and how to solve this one....
Try
If (pVal.BeforeAction = True And pVal.ItemUID = "310" And pVal.FormUID = "TT" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
Dim opt As SAPbouiCOM.OptionBtn
oform = sbo_app.Forms.Item("TT")
opt = oform.Items.Item("310").Specific
If (opt.Selected = True) Then
omatrix = oform.Items.Item("17").Specific
omatrix.Clear()
omatrix.AddRow(1)
omatrix.Columns.Item("V_7").Cells.Item(1).Click(SAPbouiCOM.BoCellClickType.ct_Regular)
Dim oitem As SAPbouiCOM.Item
oitem = oform.Items.Item("14")
oitem.Click(SAPbouiCOM.BoCellClickType.ct_Regular)
oform.Items.Item("555").Visible = False
oform.Items.Item("555").Visible = False
oform.Items.Item("6").Visible = False
oform.Items.Item("7").Visible = False
oform.Items.Item("111").Visible = False
oform.Items.Item("222").Visible = False
oform.Items.Item("3").Visible = False
oform.Items.Item("4").Visible = False
omatrix.Columns.Item("V_5").Cells.Item(1).Specific.value = ""
omatrix.Columns.Item("V_6").Cells.Item(1).Specific.value = ""
omatrix.Columns.Item("V_7").Editable = True
omatrix.Columns.Item("V_6").Editable = True
omatrix.Columns.Item("V_5").Editable = True
omatrix.Columns.Item("V_4").Editable = True
omatrix.Columns.Item("V_3").Editable = True
omatrix.Columns.Item("V_2").Editable = True
omatrix.Columns.Item("V_1").Editable = True
Dim oedit11 As SAPbouiCOM.EditText
omatrix = oform.Items.Item("17").Specific
' omatrix.AddRow(1)
oedit11 = omatrix.Columns.Item("V_7").Cells.Item(1).Specific
cflacc1()
oedit.ChooseFromListUID = "CFL3"
oedit.ChooseFromListAlias = "Acctcode"
' oedit.ChooseFromListAlias = "Cardcode"
End If
End If
Catch ex As Exception
sbo_app.MessageBox(ex.Message)
End Try
Hi..
i had updated the code..as
omatrix.Columns.Item("V_7").ChooseFromListUID = "CFL3"
omatrix.Columns.Item("V_7").ChooseFromListAlias = "Cardcode"
The previous error was gone..
See the image
After press the cfl button it is showing this one
what i had written as
IN method
Public Sub cflacc1()
Try
Dim oCFLs1 As SAPbouiCOM.ChooseFromListCollection
'Dim oCons1 As SAPbouiCOM.Conditions
'Dim oCon1 As SAPbouiCOM.Condition
oform = sbo_app.Forms.Item("TT")
oCFLs1 = oform.ChooseFromLists
Dim oCFL1 As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLCreationParams = sbo_app.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
' Adding 2 CFL, one for the button and one for the edit text.
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = "1"
oCFLCreationParams.UniqueID = "CFL3"
oCFL1 = oCFLs1.Add(oCFLCreationParams)
' Adding Conditions to CFL1
'' ''oCons = oCFL.GetConditions()
'' ''oCon = oCons.Add()
'' ''oCon.Alias = "ItemCode"
'' ''oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
'' ''oCon.CondVal = "100"
'' ''oCFL.SetConditions(oCons)
' oCFLCreationParams.UniqueID = "CFL2"
'oCFL = oCFLs.Add(oCFLCreationParams)
Catch
MsgBox(Err.Description)
End Try
End Sub
in item event
Above code(previous post) i had written and
Try
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oForm As SAPbouiCOM.Form
oForm = sbo_app.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim val As String
Try
val = oDataTable.GetValue(0, 0)
'oForm = sbo_app.Forms.Item("TT")
'oedit = oForm.Items.Item("4").Specific
'Dim orec As SAPbobsCOM.Recordset
'orec = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
'orec.DoQuery("select t0.acctname from oact t0 where t0.acctcode='" & val & "'")
'oForm.Items.Item("4").Specific.value = orec.Fields.Item(0).Value
Catch ex As Exception
End Try
omatrix = oForm.Items.Item("17").Specific
If (pVal.ColUID = "V_7") Then
If pVal.FormUID = "TT" Then
oForm = sbo_app.Forms.Item("TT")
omatrix.Columns.Item("V_7").Cells.Item(1).Specific.value = val
End If
End If
End If
End If
Catch ex As Exception
'sbo_app.MessageBox(ex.Message)
End Try
Where is the mistake i had done..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Seenu,
You are adding CFL for GL Codes, right ? then why you are giving alias name = Item Code, replace it with AcctCode
oCFLCreationParams.ObjectType = "1"
'' ''oCon.Alias = "ItemCode" // AcctCode
and in item event there is no need to run that query.
val = oDataTable.GetValue(0, 0) replace this with val = oDataTable.GetValue(1, 0)
Let us know if your problem solved with these changes.
Regards
HI...pari
i had not put ocon.alias="itemcode"
i made that one in comment.........
i chancged only according to your words...
val = oDataTable.GetValue(1, 0)
but nothing changed still same problem i am facing..
i am posting again my code
in method
Public Sub cflacc1()
Try
Dim oCFLs1 As SAPbouiCOM.ChooseFromListCollection
oform = sbo_app.Forms.Item("TT")
oCFLs1 = oform.ChooseFromLists
Dim oCFL1 As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLCreationParams = sbo_app.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = "1"
oCFLCreationParams.UniqueID = "CFL33"
oCFL1 = oCFLs1.Add(oCFLCreationParams)
Catch
MsgBox(Err.Description)
End Try
End Sub
in item event
Try
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oForm As SAPbouiCOM.Form
oForm = sbo_app.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim val As String
Try
val = oDataTable.GetValue(1, 0)
Catch ex As Exception
End Try
omatrix = oForm.Items.Item("17").Specific
If (pVal.ColUID = "V_7") Then
If pVal.FormUID = "TT" Then
oForm = sbo_app.Forms.Item("TT")
omatrix.Columns.Item("V_7").Cells.Item(1).Specific.value = val
End If
End If
End If
End If
Catch ex As Exception
'sbo_app.MessageBox(ex.Message)
End Try
in item event
Try
If (pVal.BeforeAction = True And pVal.ItemUID = "310" And pVal.FormUID = "TT" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
Dim opt As SAPbouiCOM.OptionBtn
oform = sbo_app.Forms.Item("TT")
opt = oform.Items.Item("310").Specific
If (opt.Selected = True) Then
omatrix = oform.Items.Item("17").Specific
omatrix.Clear()
omatrix.AddRow(1)
omatrix.Columns.Item("V_7").Cells.Item(1).Click(SAPbouiCOM.BoCellClickType.ct_Regular)
Dim oitem As SAPbouiCOM.Item
oitem = oform.Items.Item("14")
oitem.Click(SAPbouiCOM.BoCellClickType.ct_Regular)
oform.Items.Item("555").Visible = False
oform.Items.Item("555").Visible = False
oform.Items.Item("6").Visible = False
oform.Items.Item("7").Visible = False
oform.Items.Item("111").Visible = False
oform.Items.Item("222").Visible = False
oform.Items.Item("3").Visible = False
oform.Items.Item("4").Visible = False
omatrix.Columns.Item("V_5").Cells.Item(1).Specific.value = ""
omatrix.Columns.Item("V_6").Cells.Item(1).Specific.value = ""
omatrix.Columns.Item("V_7").Editable = True
omatrix.Columns.Item("V_6").Editable = True
omatrix.Columns.Item("V_5").Editable = True
omatrix.Columns.Item("V_4").Editable = True
omatrix.Columns.Item("V_3").Editable = True
omatrix.Columns.Item("V_2").Editable = True
omatrix.Columns.Item("V_1").Editable = True
Dim oedit11 As SAPbouiCOM.EditText
omatrix = oform.Items.Item("17").Specific
oedit11 = omatrix.Columns.Item("V_7").Cells.Item(1).Specific
cflacc1()
omatrix.Columns.Item("V_7").ChooseFromListUID = "CFL33"
omatrix.Columns.Item("V_7").ChooseFromListAlias = "Acctcode"
End If
End If
Catch ex As Exception
sbo_app.MessageBox(ex.Message)
End Try
Need your suggestions pari ...
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.