0 votes

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

image.png

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 (480 points)

1 Answer

0 votes
by (294k points)

Hello,

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

I want to add a custom column in a report that displays members of a group that shows the age of the user account in days. Is that possible?

asked Oct 23 by msheppard (610 points)
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
2 answers

I am trying to create a report-specific column (DateTime - Regular Date) where I can extract the datetime from the description field of the user object using a regular ... () $line = $object.Get("description") $dateTime = ?? $Context.Value = $dateTime

asked Feb 27 by emeisner (100 points)
0 votes
1 answer

Hello, I have a report of computers in multiple groups that I used to create a chart count of "Computers" in certain security memberships relating to agent software. ... a member of the group written in the script. Any assistance is appreciated. Thanks!

asked Nov 7, 2023 by Edogstraus00 (490 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 (2.0k points)
3,588 questions
3,277 answers
8,303 comments
548,091 users