0 votes

Trying to generate a custom report and getting an error when trying to add the resulting values back into the report columns -


The part of code causing the issue is this -

$Context.Items.Add($record, @{$initiatorBusinessPurposeColumnID = $BusinessPurpose},@{$initiatorDepartmentColumnID = $initiatorDepartment})

If I break up that line and run both separately like this -

$Context.Items.Add($record, @{$initiatorDepartmentColumnID = $initiatorDepartment}) $Context.Items.Add($record, @{$initiatorBusinessPurposeColumnID = $BusinessPurpose})

The script runs without error but it results in duplicate rows being created. Is there any way to run the $Context.Items.Add method to add multiple column values at once?

by (430 points)

1 Answer

0 votes
by (228k points)


Yes, it is possible. Have a look at section Setting values for custom columns of the following article: https://www.adaxes.com/sdk/GeneratingReports/#setting-values-for-custom-columns. Also, the following article should be helpful: https://www.adaxes.com/sdk/AdmListItems.

If you still have issues modifying your script to work the way you want, please, describe the desired behaviour in all the possible details with live examples. Also, please, provide the script you currently have. you can post it here or send to us (support@adaxes.com) in TXT format.

Related questions

0 votes
1 answer

Adaxes version is 2018.2. I have build a custom report, and I don't want the 'Name' column with the pictures to appear in it. But it seem to be mandatory, it is greyed ... . Is there a way to remove / hide / or change the mandatory attribute or column ? Thanks

asked Jan 9, 2020 by Isabelle (50 points)
0 votes
1 answer

Hi I'm trying to product a report to show the users with either E3, F3 or F5 licenses. If I add the Adaxes "Microsoft 365 Licenses" attribute directly to the report then ... from the user and show a nice "Microsoft E3" etc value. Is this possible? Thanks

asked Sep 27, 2021 by chappers77 (1.2k points)
0 votes
1 answer

I'm trying to retrive the Microsoft 365 License product name in a report as the 'Office 365 License' attribute in Adaxes shows each individual licensed product e.g. ... 365 F3"} } $productnames = $productnames -join ", " $Context.Value = $productnames

asked Jul 27, 2020 by richarddewis (260 points)
0 votes
1 answer

Hi Can you lead us to what we are doing wrong with this report? `$CID ="{ed8afa99-e34d-4531-b69a-0bd0785f4d3a}" $folders = gci -force '\server\Kunden'-ErrorAction ... Value generation = Template, empty. ColumnID is double checked an is the right one. Thanks

asked Mar 5, 2020 by maca (100 points)
0 votes
1 answer

I am modifying the 'Inactive Computers' report so we can see a calculation of the days since the computer was active. I added a script column, and have this script. It ... use Adaxes to make my team more efficient so thanks for your help on my recent tickets.

asked Aug 6, 2019 by jbadry (410 points)
2,807 questions
2,541 answers
65,270 users