There isn’t a ‘type’ property for ‘bes computer groups’ (which is why you’re getting an error that ‘type’ is not defined). To see all the elements that can be returned from ‘bes computer groups’, aside from looking at the documentation, you can leverage the following relevance:
properties whose (it as string contains "<bes computer group>")
This then might lead you to relevance such as the following to return group ‘type’:
(name of it, (if manual flag of it then "Manual" else if automatic flag of it then "Automatic" else "n/a"), number of members of it) of bes computer groups
Thanks! I was trying to figure out if there was a way to see all the “field” (sorry, too much SQL)!
I looked up Manual Flag (now that I know its name) and it says it could have a third value, “ad-hoc”. Is that something that would happen often, or is that something that really isn’t used anymore?
Now, to make it look nice: (When I try this, I get
around first property, but no
for the other three properties)
concatenation of trs of (
( td of name of it as string &
td of (if manual flag of it then "Manual" else if automatic flag of it then "Automatic" else "n/a" as string) &
td of (creation time of it as string) &
td of (number of members of it as string)
) of bes computer groups
)
but convert it to string right away.
So precedence is important and you want:
td of (name of it as string)
Example:
(html "<table>" & it & html "</html>") of
concatenation of trs of (
( td of (name of it as string) &
td of (if manual flag of it then "Manual" else if automatic flag of it then "Automatic" else "n/a" as string) &
td of (creation time of it as string) &
td of (number of members of it as string)
) of bes computer groups
)
Thank you for the explanation and the code!!! Hopefully that will help me avoid that problem in the future!
Now, to make that all look pretty (in Web Reports), I have done the following (see below)
Do you have a suggestion for a better (perhaps cleaner) way of doing this, or is this good?
<html>
<head>
<style>
h1 {
text-align: center;
}
table {
border-collapse: collapse;
}
th {
color:white;
background-color: black;
border: 1px solid white;
padding: 5px;
}
table, td {
border: 1px solid black;
padding: 5px;
}
</style>
</head>
<?relevance
(html "<table><tr> <th>Computer Group</th><th>Group Type</th><th>Creation Time</th><th>Member Count</th> </tr>" & it & html "</html>") of
concatenation of trs of (
( td of (name of it as string) &
td of (if manual flag of it then "Manual" else if automatic flag of it then "Automatic" else "n/a" as string) &
td of (creation time of it as string) &
td of (number of members of it as string)
) of bes computer groups
)
?>
</html>
Also, the line:
(html "<table> & it & html "</html>") of
Should that have been:
(html "<table> & it & html "</table>") of
That is taking the html tag <table> then concatenating the results of the following relevance (it) and then concatenating the html tag </table>
I wasn’t aware that was available, so thank you for that as well!!!