Marco
12 months agoContributor II
GetDataBufferDataCells with no data
Hi Everyone.
I have the following section of code.
'Search for values for the DataBufferCellPK, they are not empty.
Dim dbcpk As New DataBufferCellPk(
mbrRefIdAcc,
mbrRefIdFlow,
intOriginId,
mbrRefIdIC,
mbrRefIdUd1,
mbrRefIdUd2,
mbrRefIdUd3,
mbrRefIdUd4,
mbrRefIdUd5,
mbrRefIdUd6,
mbrRefIdUd7,
mbrRefIdUd8
)
'BRApi.ErrorLog.LogMessage(si, $"values of DataBufferCellPk: MbrRefIdAcc: {mbrRefIdAcc}, MbrRefIdFlow: {mbrRefIdFlow}, IntOriginId: {intOriginId}, MbrRefIdIC: {mbrRefIdIC}, MbrRefIdUd1: {mbrRefIdUd1}, MbrRefIdUd2: {mbrRefIdUd2}, MbrRefIdUd3: {mbrRefIdUd3}, MbrRefIdUd4: {mbrRefIdUd4}, MbrRefIdUd5: {mbrRefIdUd5}, MbrRefIdUd6: {mbrRefIdUd6}, MbrRefIdUd7: {mbrRefIdUd7}, MbrRefIdUd8: {mbrRefIdUd8}")
'BRApi.ErrorLog.LogMessage(si, "Parameters bufferdatacell: " & dupk.ToString & " * " & intViewId)
Using dbConnFW As DBConnInfo = BRApi.Database.CreateFrameworkDbConnInfo(si)
Using dbConnApp As DBConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si)
listDc = BRApi.Finance.Data.GetDataBufferDataCells(dbConnFW, dbConnApp, dupk, intViewId, dbcpk, False, True)
End Using
End Using
BRApi.ErrorLog.LogMessage(si, $"listDc values json: {JsonConvert.SerializeObject(listDc, Formatting.Indented)}")
Dim intTotDc As Int64 = listDc.Count
Dim k As Int64 = 0
For i = listDc.Count - 1 To 0 Step -1
Dim dc As DataCell = listDc(i)
If (dc.CellAmount = Decimal.Zero) OrElse Not (1 = 1 _
And listIntAcc.Contains(dc.DataCellPk.AccountId) _
And listIntFlow.Contains(dc.DataCellPk.FlowId) _
And listIntIC.Contains(dc.DataCellPk.ICId) _
And listIntUd1.Contains(dc.DataCellPk.UD1Id) _
And listIntUd2.Contains(dc.DataCellPk.UD2Id) _
And listIntUd3.Contains(dc.DataCellPk.UD3Id) _
And listIntUd4.Contains(dc.DataCellPk.UD4Id) _
And listIntUd5.Contains(dc.DataCellPk.UD5Id) _
And listIntUd6.Contains(dc.DataCellPk.UD6Id) _
And listIntUd7.Contains(dc.DataCellPk.UD7Id) _
And listIntUd8.Contains(dc.DataCellPk.UD8Id)) Then
strLog.AppendLine($"{strBRName} - Removing {Me.PrintDataCell(si, dc)}")
listDc.RemoveAt(i)
k += 1
End If
Next
It doesn't give me any results, so I wanted to know where I can add the information to get results.
The way I would troubleshoot this is two fold:
1. create a quickview in Excel using exactly the same members you're passing in to the databuffer. This is a sanity check to say "Yes data exists where I expect it to" or "Oops, I thought it was there but I have this one thing off..."
2. You said this works perfectly in another system. Same code, different application. its not the code. look at what else might be different.