Hi,
I am trying the New-UDSQLTable to display some results from our SQL. It can display the result on the dashboard successfully. However, I always get this error message when I load the result on the page:
AM An error occurred: Cannot bind argument to parameter ‘InputObject’ because it is null.
What does this mean?
I have also found that the page count is incorrect. I have some “where” clauses inside the sql query. But when I check out the page, it shows the total page count from the whole sql table. How can I set it correctly?
And the last question, is there a way I can set the display all results instead of 5 rows per page?
Thanks so much!
Here is my code:
New-UDDashboard -Title "Hello, World!" -Content {
New-UDTypography -Text "Hello, World!"
$Parameters = @{
Title = "Test"
Query = "SELECT AssignmentName, DeviceName, LastComplianceMessageDesc, LastComplianceMessageTime, LastEnforcementMessageTime, LastEnforcementMessageDesc,
CASE LastEnforcementErrorCode WHEN '0' THEN 'Success' WHEN '-2016409844' THEN 'Software update execution timeout' WHEN '-2016409966' THEN 'Group policy conflict' WHEN '-2016410008' THEN 'Software update still detected as actionable after apply'
WHEN '-2016410012' THEN 'Updates handler job was cancelled' WHEN '-2016410026' THEN 'Updates handler was unable to continue due to some generic internal error' WHEN '-2016410031' THEN 'Post install scan failed'
WHEN '-2016410032' THEN 'Pre install scan failed' WHEN '-2016410855' THEN 'Unknown error' WHEN '-2016411012' THEN 'CI documents download timed out' WHEN '-2016411115' THEN 'Item not found' WHEN
'-2145107951' THEN 'WUServer policy value is missing in the registry.' WHEN '-2145120257' THEN 'An operation failed due to reasons not covered by another error code.' WHEN '-2145123272' THEN 'There is no route or network connectivity to the endpoint.'
WHEN '-2145124320' THEN 'Operation did not complete because there is no logged-on interactive user.' WHEN '-2145124341' THEN 'Operation was cancelled.' WHEN '-2146498304' THEN 'Unknown error' WHEN
'-2146762496' THEN 'No signature was present in the subject.' WHEN '-2146889721' THEN 'The hash value is not correct.' WHEN '-2147010798' THEN 'The component store has been corrupted.' WHEN '-2147010815'
THEN 'The referenced assembly could not be found.' WHEN '-2147010893' THEN 'The referenced assembly is not installed on your system.' WHEN '-2147018095' THEN 'Transaction support within the specified resource manager is not started or was shut down due to an error.'
WHEN '-2147021879' THEN 'The requested operation failed. A system reboot is required to roll back changes made.' WHEN '-2147023436' THEN 'This operation returned because the timeout period expired.' WHEN
'-2147023728' THEN 'Element not found.' WHEN '-2147023890' THEN 'The volume for a file has been externally altered so that the opened file is no longer valid.' WHEN '-2147024598' THEN 'Too many posts were made to a semaphore.'
WHEN '-2147024784' THEN 'There is not enough space on the disk.' WHEN '-2147217865' THEN 'Unknown error' WHEN '-2147467259' THEN 'Unspecified error' WHEN '-2147467260' THEN 'Operation aborted' ELSE
'Pending Reboot' END AS 'Last Message'
FROM dbo.vSMS_SUMDeploymentStatusPerAsset
WHERE (AssignmentName = N'internalpatch') AND (LastComplianceMessageDesc = N'Non-compliant')
"
CountQuery = "SELECT COUNT(*) as Count FROM dbo.vSMS_SUMDeploymentStatusPerAsset"
Columns = @( "DeviceName", "LastComplianceMessageTime", "LastEnforcementMessageDesc", "Last Message")
SqlInstance = "XXX"
Database = "CM_XXX"
}
New-UDSQLTable @Parameters
}