SteveK
12 days agoNew Contributor III
Subtle bug in Example for Dynamic Dimensions
In the example code for the Dynamic Dimension Service there appears to be a subtle bug which will affect refresh of the dimensions.
ReadDynamicDimensionInfo(...) returns DateTime.Now:
' This api method will build the required object, straight from an SQL query.
Return api.ReadDynamicDimensionInfo(si, args, DateTime.Now, numSecondsBeforeCheckTS, _
dbConn, sql.ToString, Nothing, Nothing, _
"Name", "Description", "UniqueID", "Name", "Parent", "ParentID", "Parent", "AggWeight", True)
BUT ReadDynamicDimensionContentTimestamp sets the Timestamp as DateTime.UTCNow:
'Refresh once per minute (note: frequent refreshes such As one minute could degrade performance).
Dim utcNow As DateTime = DateTime.UtcNow
Return New DateTime(utcNow.Year, utcNow.Month, utcNow.Day, utcNow.Hour, utcNow.Minute, 0, 0, DateTimeKind.Utc)
This will matter if your refresh period is < 13(?) hours AND if your TimeZone is ahead of UTC......
It's an easy fix though!
Steve