How do I use getscalar to count entities for a field vault = "0001"?
I thought I understood, but it wants an expression and I don't know what to put for the expression when I just want to count.
I thought an expression could be a field: customerfields.id for example, but error says:
Unable to cast object of type 'SD.LLBLGen.Pro.ORMSupportClasses.EntityField' to type 'SD.LLBLGen.Pro.ORMSupportClasses.IExpression'.
Here is my code:
Protected Sub vaultCount_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles vaultCount.Click
Dim vaults As New VaultCollection
Dim aSort As New SortExpression
aSort.Add(New SortClause(VaultFields.Orderx, SortOperator.Ascending))
vaults.GetMulti(Nothing, 0, aSort)
For Each vault As VaultEntity In vaults
Dim boxs As New StorageCollection
Dim vaultCount As Integer = CInt(boxs.GetScalar(StorageFieldIndex.Id, StorageFields.Id, AggregateFunction.Count, StorageFields.Vault = vault.Name))
vault.Count = vaultCount
vault.Save()
Next
Profile.RptParams.Clear()
Profile.ReportPath = "/nwmrpts/vaultcount"
Response.Redirect("reports.aspx")
End Sub
TIA