on 04-29-2009 7:46 AM
Dear All,
In my scenario am using stock transfer when am click ADD Button In the below code the bolded item shows an error but the error msg will not be displayed on the screen ,
If (pVal.FormUID = "FormEditor") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) And (pVal.ItemUID = "1") And pVal.Before_Action = True Then
Try
Dim oStockTransfer As SAPbobsCOM.StockTransfer
Dim return_value As Integer
Dim SerrorMsg As String
Dim ItemNo As String
Dim Fwh As String
Dim ItemDes As String
Dim ToWh As String
Dim Qua As String
Dim itemCost As String
For i As Integer = 1 To oMatrix.RowCount
ItemNo = oMatrix.Columns.Item("V_2").Cells.Item(i).Specific.Value()
ItemDes = oMatrix.Columns.Item("V_1").Cells.Item(i).Specific.Value()
Fwh = oMatrix.Columns.Item("V_9").Cells.Item(i).Specific.Value()
ToWh = oForm.Items.Item("27").Specific.Value
Qua = oMatrix.Columns.Item("V_7").Cells.Item(i).Specific.Value()
itemCost = oMatrix.Columns.Item("V_11").Cells.Item(i).Specific.Value()
oStockTransfer = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer)
oStockTransfer.FromWarehouse = Fwh
oStockTransfer.Lines.ItemCode = ItemNo
oStockTransfer.Lines.ItemDescription = ItemDes
oStockTransfer.Lines.WarehouseCode = ToWh
oStockTransfer.Lines.Quantity = Qua
oStockTransfer.Lines.Rate = itemCost
oStockTransfer.Lines.Add()
Next
return_value = oStockTransfer.Add
If return_value = 0 Then
ocompany.GetLastError(return_value, SerrorMsg)
oForm.StatusBar.SetText(SerrorMsg, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
Else
oForm.StatusBar.SetText(SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success)
End If
Catch ex As Exception
oForm.StatusBar.SetText(ex.Message)
End Try
End If
Can Anyone tell me the exact error in the above Code
Regards,
Guru
Dear Vijay Guru,
Please try to put the code
oStockTransfer = ocompany.GetBusinessObject (SAPbobsCOM.BoObjectTypes.oStockTransfer)
oStockTransfer.FromWarehouse = Fwh
before the For...Next loop since it is should not to call repeatedly in the loop.
Best Regards
Jane Jing
SAP Business One Forums team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Vijay Guru,
Please try following code
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Best Regards
Jane Jing
SAP Business One Forums team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.