0 votes

Hi,

while test driving Adaxes with a bunch of 100 users out of 3000 we encountered an annoying issue.

We had set up a drop down menu where people can select their "Office", based on the selection the address is filled too. In our case we created new standards which may not fit the current Office value in AD and people get a constraint violation warning which is absolutely correct but when they extend the drop down menu they still see the old value which was present in the Office field before, that's confusing and people start asking why they get a warning when they can see it in the list.

Next question how do I adjust the Constraint Violation warning as I can do it when using regular expression.
In the moment it only says "must be one of"

but we want it to be the same as our help information.

Thanks in advance
Ingemar

by (960 points)

1 Answer

0 votes
by (216k points)

Hello Ingemar,

Currently this cannot be achieved, but thanks for your suggestions! We'll discuss both the suggestions when deciding on the functionality for future releases.

As for removing the invalid value from the drop-down list, there's a high probability that this will be implemented in one of the nearest releases. As for showing the Help message instead of the error message, that is not that simple. We cannot just replace the error message. Not all of our customers have a help message that actually looks like an error message, as you do, and it is definitely not going to suit all of our customers. If we find a way how to combine both the error message and the help message, we will add such functionality in one of the future releases.

0

Thanks for the answer but on the error message issue, why is it possible for "must match regexp" but not for "must be one of the following values only"

Is there at least an option to clear the Office field up front before it is populated, maybe with a business rule or something?

0

why is it possible for "must match regexp" but not for "must be one of the following values only"

We added custom error messages for regular expressions because it is hard to give a generic error message when regular expressions are used. Regular expressions may check for many things, and ordinary users are not supposed to be good at regular expressions. So, an error message saying that the value should correspond to this or that regular expreession may be very confusing.

In any case, thanks for the suggestion. Maybe, we'll make the option of setting custom error message for all constraint types, not only for 'Must match regular expression'.

Is there at least an option to clear the Office field up front before it is populated, maybe with a business rule or something?

A Business Rule cannot be used in this case for the following reasons:

  • A Business Rule cannot be triggered on opening the form for editing users.
  • If you create a Business Rule triggered before updating a user, and there is a constraint violation on the page for editing users, the Business Rule will not be triggered because the operation will be terminated even before any Business Rules are applied.

What you can do in this case is to create a Scheduled Task that will check for each user whether the value of the Office property is allowed by the Property Pattern and will delete the Office property if the value is not allowed.

0

Thanks for the update!

Can you show me how such a scheduled task would look like?

0

Hello Ingemar,

Yes, sure. To create such a Scheduled Task:

  1. Create a new Scheduled Task.

  2. On the 3rd step of the Create Scheduled Task wizard, select the User object type.

  3. On the 4th step, select the Run a program or PowerShell script action and paste the following script in the Script field:

     # Get user office
     try
     {
         $Context.TargetObject.GetInfo()
         $propertyEntry = $Context.TargetObject.GetPropertyItem("physicalDeliveryOfficeName", "ADSTYPE_CASE_IGNORE_STRING")
     }
     catch
     {
         return
     }
    
     # Get Property Patterns effective for the user
     try
     {
         $propertyPatternDNs = $Context.TargetObject.GetEx("adm-EffectivePropertyPatterns")
     }
     catch
     {
         return
     }
    
     foreach($propertyPatternDN in $propertyPatternDNs)
     {
         # Bind to the Property Pattern
         $propertyPattern = $Context.BindToObjectByDN($propertyPatternDN)
    
         # Search the Pattern for the Office property
         foreach($item in $propertyPattern.Items)
         {
             if ($item.PropertyName -ine "physicalDeliveryOfficeName")
             {
                 continue
             }
    
             $constraints = $item.GetConstraints()
             foreach($constraint in $constraints)
             {
                 $errorMsg = $NULL
                 $propertyEntry.ControlCode = "ADS_PROPERTY_UPDATE"
    
                 if (!($constraint.Check($propertyEntry, $Context.TargetObject, [ref]$errorMsg)))
                 {
                     $Context.TargetObject.Put("physicalDeliveryOfficeName", $NULL)
                     $Context.TargetObject.SetInfo()
                     return
                 }
             }
         }
     }
    
  4. On the 5th step, include the users for which you want to check the Office property in the Activity Scope of the Task.

Also, you can create a Custom Command to perform the check on demand:

  1. Create a new Custom Command.
  2. On the 2nd step of the Create Custom Command wizard, select the User object type.
  3. On the 3rd step, select the Run a program or PowerShell script action and paste the above script in the Script field.
0

Awesome thank you!

Last question, the PowerShell code only searches the property pattern that matches Office correct?

0

Ingemar,

Yes, the PowerShell script checks the value of the Office property of the user against the Property Pattern(s) applied to the user. It doesn't check the other properties.

0

great thank you.

Will test it right away.

Related questions

0 votes
1 answer

The section is not defined in the available options in Adaxes and it is in the AD as well. Eg; I need to add a section called ' Security Access' and have it ... to select from options like User Directory, Internet access, Track-It account , SAP access etc.

asked Oct 13, 2021 by Aishwarya Gavali (40 points)
0 votes
1 answer

Hi I need a special company subsidaries parameter, where i would like to have the name of all the subsidary company as drop down and use this parameter in the create user page. ... but how can i insert a drop down menu in it? Thanks for your support Kamini

asked Feb 11, 2022 by Kamini (80 points)
0 votes
1 answer

Is it possible to create a drop down that displays options based on the selection in another field? EX: I want to create a job title background that will populate options ... like the Job title drop down to display "Customer service rep, call support, etc".

asked Oct 11, 2021 by copatterson (70 points)
0 votes
1 answer

When attempting to add a business unit as a trustee for a security role, it is not visible under the "Look in" drop down in the Assign Role window.

asked Jul 20, 2021 by ryan741 (120 points)
0 votes
1 answer

Hello, We are trying to accomplish supplying multiple "office" entires into AD from the create user form. We have employees that belong to multiple physical offices. Is ... the form and also select multiple offices for an employee. Thanks for your assistance!

asked Oct 26, 2020 by sgordon213 (110 points)
3,548 questions
3,239 answers
8,232 comments
547,814 users