Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Custom Query - For updating Account Owner

krishna_sk
New Contributor III
New Contributor III

Hello,

Can anyone help us with the CustomQuery used to update the Account owner where the Username of the Account owner is stored in Customproperty36 of Accounts.

Appreciate your help!

 

8 REPLIES 8

krishna_sk
New Contributor III
New Contributor III

@rushikeshvartak Can you take a look at this when you got time. Thank you

Sivagami
Valued Contributor
Valued Contributor

Any reason for not using user account correlation rule for your use case?

Sivagami_0-1676451837422.png

krishna_sk
New Contributor III
New Contributor III

These are Service Accounts so we thought to use the CustomQuery.

Sivagami
Valued Contributor
Valued Contributor

Got it, @krishna_sk .

Something like this might help. Alter the query with your endpoint key and account status that needs to be considered.

INSERT INTO accountowners(accountkey, owneruserkey, rank, updatedate, updateuser) SELECT a.accountkey AS accountkey, u.userkey AS owneruserkey, '1' AS rank, Now() AS updatedate, '1' AS updateuser FROM accounts a LEFT JOIN users u ON a.customproperty36 = u.username WHERE a.endpointkey = <insert your endpointkey> AND a.status IN ( 1, 'Manually Provisioned')  

 

krishna_sk
New Contributor III
New Contributor III

Sivagam, Thank you for the response. The Query ran successfully, but it doesn't updated the Owner and didn't thrown any error as well.

Why don't you use upload CSV to update account owner instead of using custom query?

I won't suggest using custom query wherever there is a possibility to achieve it in otherways. Custom Query is last option that we should opt. 


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

DaanishJawed
Saviynt Employee
Saviynt Employee

Hi Krishna,

Refer the below document to upload account owners using CSV file.

https://docs.saviyntcloud.com/bundle/EIC-Admin-v231/page/Content/Chapter02-Identity-Repository/Uploa...

krishna_sk
New Contributor III
New Contributor III

Hi Sk,

I Agree with the CSV approach. Currently our client is not interested with the manual approach. Hence I am looking for any workaround.

I checked the Sav for Sav DB approach but it doesn't fulfills the requirement (confirmed by saviynt support as well).

Thank you.