Hello,

I believe I've come across a bug in 2019.1. When working inside a custom command with two parameters, I'm trying to add conditions to an Else if statement that look at the two parameters. When trying to add the second condition it simply overwrites the existing parameter condition, and doesn't allow me to have both parameters conditions under the same else if. I've tested this with the top level if statement and it works, but not inside an else if statement.

Any thoughts on how to make this work?
Thanks!

by (920 points)

1 Answer

by (305k points)
Best answer
0 votes

Hello Ryan,

We confirm this is an issue in Adaxes. We will fix it in the next release. For now, you can use the If PowerShell script returns true condition instead of the If one. In the condition, use the below script. In the script, the $valueToCheck variable specifies the value that will be compared with the parameter value. If you need the script to return true when the parameter is checked, use the corresponding value specified in the parameter configuration.

$valueToCheck = "1" # TODO: modify me
$parameterValue = $Context.GetParameterValue("param-AddPhoto")

$Context.ConditionIsMet = $parameterValue -eq $valueToCheck

If this workaround does not meet your needs, we can provide you with a custom build of Adaxes that will include a fix for the issue.

by (920 points)
0

That's perfect. Thanks!

Related questions

Is there a way to configure a Custom Command parameter to accept multiple values so I can then add them to a multi value attribute such as adm-CustomAttributeObjectMultiValue1 ... in my specific case I'm looking to use a directory object picker parameter

asked Nov 27, 2024 by AM (50 points)
0 votes
1 answer

We've the following script we want to use in Adaxes to create as part of user creation, to ask if the user will need a AWS workspace, then asks employeetype for different ... "Error") exit(-1) } else { $Context.LogMessage("Created workspace", "Information") }

asked May 3, 2024 by Plusa (20 points)
0 votes
1 answer

Dear support, I'm trying to automate network share creations via custom commands. They idea is to create share and groups with command A and schedule ... "ADS_SCOPE_BASE" $scopeItem.Exclude = $False $scopeItem.SetInfo() $task.ActivityScopeItems.Add($scopeItem)

asked Jan 27, 2020 by Dmytro.Rudyi (920 points)
0 votes
1 answer

We have several scripts that use the following action: $commandID = "{b4b66610-be71-403a-a6b7-8bcf51d200ef}" $user.executecustomCommand($commandID) is there syntax that allows ... is there another way to pass parameters to a custom command through scripting?

asked Jul 11, 2019 by ggallaway (300 points)
0 votes
1 answer

I have created a "Custom Command" to grant access to users to two different groups, and set them as "Hybrid" and "Temporary", with "Start and End Date", and need to ... Date" to only show if the "Temporary" option is selected. Can anyone assist? Thank you.

asked Aug 15 by cllano (30 points)
+1 vote
1 answer