Adding an sql script os it will run on a schedule

Hello,

I'm trying to integrate an sql script* that will update the person central account name which in turn will update ADSAccount samaccountname and AD via the connector.

When I manually change Person's central account name it works but when I run the script on object browser it doesn't triggers and ADSaccount update process.

I was told that this is expected and that I will need to integrate the script in OIM for it to work the same way as when I set it manually.

My question is   how can I achieve that? 

*with person_cte as (
Select
Person.UID_Person,
Person.CentralAccount,
Person.IsInActive,
ADSAccount.SAMAccountName,
Person.ExitDate,
replace(Person.CentralAccount, '.','_') as new_account
From
Person Inner Join
ADSAccount On ADSAccount.UID_Person = Person.UID_Person
Where
Person.IsInActive = 1 And
ADSAccount.SAMAccountName Not Like N'%[_]%' And
ADSAccount.SAMAccountName Like N'%[.]%' And
Person.ExitDate < GetDate() - 180
)
--select * from person_cte

merge Person target using person_cte source on target.UID_Person=source.UID_Person
when matched
then update set target.CentralAccount= source.new_account;

Top Replies

Parents
  • Changes made to a Person's centralaccount are populated via the object layer to the ADSAccount.
    Value changes made by SQL queries bypass the object layer and there for won't cause changes at other objects.

    To properly handle this use case, write a DialogScript that performs the changes by loading the effected Person objects, changing the CentralAccount value and saving the objects.
    This script can be execute in the Object Browser or Designer. If needed scripts can also be executed by a Process that can be triggert by a schedule.

Reply
  • Changes made to a Person's centralaccount are populated via the object layer to the ADSAccount.
    Value changes made by SQL queries bypass the object layer and there for won't cause changes at other objects.

    To properly handle this use case, write a DialogScript that performs the changes by loading the effected Person objects, changing the CentralAccount value and saving the objects.
    This script can be execute in the Object Browser or Designer. If needed scripts can also be executed by a Process that can be triggert by a schedule.

Children