Hello,
I am new to the community and I am attempting to create my first IDO extension Class Assembly but I am already stuck. I am attempting to take the Acct and Description from the SLArtranAlls ido and add it to the SLAcccountsReceivableAging. I will paste my code below,:
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Transactions
Imports System.Data
Imports Mongoose.Core.Common
Imports Mongoose.Core.DataAccess
Imports Mongoose.IDO
Imports Mongoose.IDO.Protocol
Namespace ue_JMW_AccountsReceivableAgingReport
' <IDOExtensionClass( "ue_JMW_AccountsReceivableAgingReport" )>
Public Partial Class ue_JMW_AccountsReceivableAgingReport : Inherits IDOExtensionClass
Public Function ue_JMW_AccountsReceivableAgingReport(ByVal StandardInputParms As String) As DataTable
Dim Infobar As String = ""
Dim sSiteRef As String
Dim sFilter As String
Dim sAcct As String
Dim sDescription As String
Dim oSLArtranAlls as LoadCollectionResponseData
Try
Dim loadCol As LoadCollectionResponseData
Dim StdOutputParms As String = ""
loadCol = GetStandardReportData(StandardInputParms, StdOutputParms)
If loadCol.Items.Count = 0 Then Return Nothing
Dim dt As DataTable = New DataTable()
Dim dtRow As DataRow
If String.IsNullOrEmpty(StdOutputParms) Then Return Nothing
Dim StdOutputParmsArr As String() = StdOutputParms.Split(","c)
For k As Integer = 0 To StdOutputParmsArr.Length - 1
dt.Columns.Add(StdOutputParmsArr(k).ToString())
Next
For j As Integer = 0 To loadCol.Items.Count - 1
dtRow = dt.NewRow()
For i As Integer = 0 To StdOutputParmsArr.Length - 1
dtRow(StdOutputParmsArr(i)) = loadCol(j, StdOutputParmsArr(i))
Next
dt.Rows.Add(dtRow)
Next
' add custom columns
dt.Columns.Add("ue_JMW_Acct")
dt.Columns.Add("ue_JMW_Description")
For each oRow as DataRow in dt.Rows
sSiteRef = oRow("SiteRef").ToString.Trim()
sFilter = "SiteRef = '"+sSiteRef+"'"
oSLArtranAlls = Me.Context.Commands.LoadCollection("SLArtranAlls", "Acct,Description", sFilter, "", 1)
If oSLArtranAlls.Items.Count > 0
sAcct = oSLArtranAlls.Items(0).PropertyValues(0).Value
sDescription = oSLArtranAlls.Items(0).PropertyValues(1).Value
oRow("ue_JMW_Acct") = sAcct
oRow("ue_JMW_Description") = sDescription
End if
Next oRow
return dt
Catch ex As Exception
Return Nothing
End Try
End Function
Public Function GetStandardReportData(ByVal StandardInputParms As String, ByRef StdOutputParms As String) As LoadCollectionResponseData
Dim loadCol As LoadCollectionResponseData
Dim OutputParms As String = ""
loadCol = me.context.commands.LoadCollection("IdoMethodResultSets", "CollectionName,MethodName,PropertyName,Sequence", "CollectionName='SLAccountsReceivableAgingReport' AND MethodName='Rpt_AccountsReceivableAgingSp'", "Sequence", 0)
If loadCol.Items.Count = 0 Then Return Nothing
For i As Integer = 0 To loadCol.Items.Count - 1
OutputParms += loadCol(i, "PropertyName").Value & ","
Next
OutputParms = OutputParms.TrimEnd(","c)
StdOutputParms = OutputParms
Dim requestLoadCol As LoadCollectionRequestData = New LoadCollectionRequestData()
requestLoadCol.IDOName = "SLAccountsReceivableAgingReport"
requestLoadCol.PropertyList.SetProperties(OutputParms)
requestLoadCol.CustomLoadMethod = New CustomLoadMethod()
requestLoadCol.CustomLoadMethod.Name = "Rpt_AccountsReceivableAgingSp"
If Not String.IsNullOrEmpty(StandardInputParms) Then
Dim StandardParmsArr As String() = StandardInputParms.Split(","c)
For k As Integer = 0 To StandardParmsArr.Length - 1
requestLoadCol.CustomLoadMethod.Parameters.Add(StandardParmsArr(k).ToString())
Next
End If
requestLoadCol.RecordCap = 0
requestLoadCol.OrderBy = ""
loadCol = me.context.commands.LoadCollection(requestLoadCol)
Return loadCol
End Function
End Class
End Namespace
When I try to build the assembly in CSI, I get the following error message:
ue_JMW_AccountsReceivableAgingReport(6) : warning BC40056: Namespace or type specified in the Imports 'System.Data' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
ue_JMW_AccountsReceivableAgingReport(16) : error BC30002: Type 'DataTable' is not defined.
ue_JMW_AccountsReceivableAgingReport(34) : error BC30002: Type 'DataTable' is not defined.
ue_JMW_AccountsReceivableAgingReport(34) : error BC30002: Type 'DataTable' is not defined.
ue_JMW_AccountsReceivableAgingReport(35) : error BC30002: Type 'DataRow' is not defined.
ue_JMW_AccountsReceivableAgingReport(58) : error BC30002: Type 'DataRow' is not defined.
I have tried to move the IMPORTS SYSTEM.DATA but the define errors still remain. Please provide help.