0 votes

Hello,

I have small issue with a business rule not being activated upon an update.

I am using a scheduled task and on certain conditions we are updating the adm-CustomAttributeBoolean1 field with the following code:

        $Context.TargetObject.Put("adm-CustomAttributeBoolean1", $True)
        $context.TargetObject.PutEx("ADS_PROPERTY_UPDATE","adm-CustomAttributeTextMultiValue1",$array)
        $context.TargetObject.SetInfo()

We also have a businessrule active After updating a User with the following check :

If the 'adm-CustomAttributeBoolean1' property has changed

Now when the scheduled task runs on a test user. The fields are actually being updated, but the business rule is not being activated.
But when I manually adjust the field within the adaxes console ( on the same object) it does trigger the business rule.

Am i missing anything ? :)

Kr,
Serge

by (470 points)

1 Answer

0 votes
by (216k points)

Hello Serge,

The thing is that $Context.TargetObject exposes an interface that does not trigger the command pipeline. In other words, this means that setting properties via this property will not trigger any Business Rules. Is there any specific reason why you use a script to set the properties, and not the built-in Update the User action?

0

I use a script because i want to find unnecessary groups (Based on SAP info) on a user and delete them. ( With a setback of 30 days because of the possible loss of rights)
That is why i put the group names and a removal date in virtual attributes.
But i can separate the Boolean from the script of course and trigger the business rule with a built-in command.

Will give it a try, but it guess it will work like that.
Thanks for the reply.

Related questions

0 votes
1 answer

I need a way of triggering a business rule based on the user (and not the group) being added or removed from a group. The reason I would like this triggered on the user is so ... prefer not to do that. I am checking to see if there is another way to do this.

asked May 16, 2023 by mark.it.admin (2.3k points)
0 votes
1 answer

I am searching for a good workflow for changing the manager field of users when there is a change in management. I was thinking of doing it based off job title. So I was ... of job titles so that would be ideal. Thanks for the help and the awesome product.

asked Oct 1, 2022 by Dynamic6553 (20 points)
0 votes
1 answer

Hi, I would like to run a scheduled task against a business unit, instead of whole OU and filter inside the task. I can select business units for the activity scope ( ... generated and then task runs against it? Next time BU will be generated again? Thanks.

asked Oct 4, 2023 by wintec01 (1.5k points)
0 votes
1 answer

Good afternoon, I am attempting to create a report to flag Users where the email address in AD does not match the email address in our Payroll system. I am able to use ... ) to grab User objects. Any help or input would be greatly appreciated. Thank you, Keith

asked Aug 12, 2021 by kfrench (20 points)
0 votes
1 answer

I have a 'Before user account creation' business rule that starts as follows: If script 'Validate user exists' returns true then Do Nothing // rest of ... experiencing a bug where $Context.Cancel is not properly terminating the business rule. Thanks.

asked Dec 17 by lw.fa (150 points)
3,589 questions
3,278 answers
8,303 comments
548,122 users