0 votes

Version 3.7.13430.0 (64 bit)

Hi,

I have a business rule for manager changes which sends to the current manager for authorisation.
I would like it to skip this authorisation if the current manager is blank.

Can you help please?

The step currently looks like this:

$Context.SubmitForApproval(@($null), $True, $False, $False, $False)

by (840 points)
0

Hello,

Could you post here or send us (support[at]adaxes.com) in TXT format the Submit to old manager script?

0

Hi,

Here it is :D

$newValue = $Context.GetModifiedPropertyValue("manager")  
$Context.SubmitForApproval(@($newValue), $False, $False, $False, $False)

Thanks.

1 Answer

0 votes
by (272k points)
selected by
Best answer

Hello,

Actually, your script gets the new manager that was set for a user, not the old one. For details check the GetModifiedPropertyValue method description in our SDK: https://www.adaxes.com/sdk/?ExecuteScri ... Class.html. To achieve what you need, use the below script:

try
{
    $manager = $Context.TargetObject.Get("manager")
{
   return
}
$Context.SubmitForApproval($manager, $False, $False, $False, $False)

Related questions

0 votes
1 answer

Is it possible, using a business rule, to reassign a user's direct reports to their manager when they get disabled? For example, User B reports up to User A. User B gets disabled and all of their direct reports automatically get assigned to User A. Thanks

asked Jul 6, 2020 by bavery (250 points)
0 votes
1 answer

When I add the property MsExchActiveSyncEnabled it seems to always be blank. How to fix?

asked Apr 22, 2022 by nate2 (90 points)
0 votes
1 answer

I'm wondering if there are any recommended ways to do this in Adexes as part of the deprovisioning or mover process? For example.... When de-provisioning any user, check ... with the initiator is possible Any ideas on how to do this please? Thanks, Bernie

asked Sep 21, 2019 by Bernie (310 points)
0 votes
1 answer

I have made a deprovision custom command. I cannot change the attribute directReports, so was thinking - i could take the people in the directReports field of the manager ... (and its subordinates) that im running the deprovision custom command from. Any tips?

asked Mar 21 by EdgarsABG (50 points)
0 votes
1 answer

Hi, I am trying to clear the manager of disabled accounts and created a scheduled task for this Right now it is failing for all users (currently 4 in total) With error ... but it won't also remove/clear the manager. All user still have the attribute set.

asked Jan 30 by wintec01 (1.1k points)
3,350 questions
3,051 answers
7,791 comments
545,075 users