cancel
Showing results for 
Search instead for 
Did you mean: 

updating an attribute based on another SAP IDM

pbadalinc
Explorer
0 Kudos
579

Hi IDM ers

i have a custom text boolean(Presentation) attribute ZMX_CONTRACTOR whose value depends on if MX_FS_WORK_CONTRACT_ID is populated or not.

if populated value = 1 if empty value=0

I use it in the search user form as a checkbox for contractor search.

what would be best way to implement?

i tried below sql for attribute values >sql query . it doesnot update in IDM. the syntax is Oracle specific:

select count(*) from dual where exists (select * from idmv_VALlINK_EXT2 where MCATTRNAME = 'MXFS_WORK_CONTRACT_ID' )

any help would be appreciated

Accepted Solutions (0)

Answers (3)

Answers (3)

alexanderbrietz
Active Contributor
0 Kudos

Hi Prasad,

the changetype in both passes should be modify! AFAIK there is no changetype insert and changetype delete means that you delete the object which is the MX_PERSON you selected.

I assume that you are using IDStore self for your selections?

Did you already add the custom attribute ZMX_CONTRACTOR and make it available for entrytype MX_PERSON?

The assignment in the add pass should be ZMX_CONTRACTOR: 1 because there is no value set for %ZMX_CONTRACTOR% which would result into the attribute (flag) not being set.

The assignment in the delete pass should be ZMX_CONTRACTOR: %% to empty/delete the attribut (flag).

As for your SQL-Queries please test them thoroughly and then use them for your sources. I cannot help much in this regard because I have a different data set.

If you have further questions please add a screenshot of your passes for source and destination. And please be more specific about the problems you have.

Regards,

Alex

pbadalinc
Explorer
0 Kudos

Alex:

thanks for quick reply.

yes there is a change type "insert" . it works. the reason for insert is- the record is missing when i query view IDMV_VALUE_BASIC and only appears in sql on view when "Modify Identity" form is submitted after populating "MX_FS_WORK_CONTRACT_ID" .and record is deleted when i remodify Identity with empty string in "MX_FS_WORK_CONTRACT_ID". so unless i use another view the setting of "ZMX_CONTRACTOR" works.

im more interested in tuning the resetting pass of the "ZMX_CONTRACTOR" flag in job

Answer to your questions

I assume that you are using IDStore self for your selections? YES

Did you already add the custom attribute ZMX_CONTRACTOR and make it available for entrytype MX_PERSON? YES

The assignment in the add pass should be ZMX_CONTRACTOR: 1 because there is no value set for %ZMX_CONTRACTOR% which would result into the attribute (flag) not being set. YES THANKS I FIGURED THAT

The assignment in the delete pass should be ZMX_CONTRACTOR: %% to empty/delete the attribute (flag). YES THANKS

I also wanted to try the Process/TASK/Script way of doing things. any help there would be appreciated.

Thanks

Prasad

pbadalinc
Explorer
0 Kudos

I went ahead and created a job for inserting record for ZMX_contractor . need help with fine tuning job especially the deletion of the record when attribute MX_FS_WORK_CONTRACT_ID is reset to blank

should i use distinct?

should i use a different view? the insert part worked good

job type: To IdentityStore

pass: setContractorflag

source:

select A.MSKEY , A.AttrName, A.aValue from IDM_OPER.IDMV_VALUE_BASIC A where A.ATTRNAME= 'MX_FS_WORK_CONTRACT_ID' and not exists(select 1 from IDM_OPER.IDMV_VALUE_BASIC B where A.mskey = B.mskey and B.ATTRNAME = 'ZMX_CONTRACTOR' )

Destination:

MSKEYVALUE : %MSKEYVALUE%

ZMX_CONTRACTOR: 1 or %ZMX_CONTRACTOR%

Changetype : insert

pass: resetContractorflag( to delete the record when attribute MX_FS_WORK_CONTRACT_ID is reset to blank)

source:

select distinct A.MSKEY , A.AttrName, A.aValue from IDM_OPER.IDMV_VALUE_BASIC A where A.ATTRNAME='ZMX_CONTRACTOR' and not exists(select 1 from IDM_OPER.IDMV_VALUE_BASIC B where A.mskey = B.mskey and B.ATTRNAME = 'MX_FS_WORK_CONTRACT_ID' )

Destination:

MSKEYVALUE : %MSKEYVALUE%

ZMX_CONTRACTOR: %ZMX_CONTRACTOR%

Changetype : delete

any input appreciated!!

Prasad

alexanderbrietz
Active Contributor
0 Kudos

Hi Prasad,

I am not sure how to answer your question, because I think it's somehow ambiguous.

First, you need to get your SQL sorted out. It should iterate on the apropriate entrytypes that should get this custom attribute. For these entrytypes you would need the MSKEYVALUE to work with in IDM. Also, the view VALLINK is not ideal for this. You should use a VALUE view instead for a value attribute.

Second, I would populate the custom attribute ZMX_CONTRACTOR using a job with a toIdentityStore-Pass. Source would be the SQL-statement used with SAP IDM DB. As Destination you would have MSKEYVALUE - %MSKEYVALUE%, changetype - modify, ZMX_CONTRACTOR - %<Value from your SQL as result>%.

Regards,

Alex

pbadalinc
Explorer
0 Kudos

Thanks a lot Alex. looks like i will have to go the route of creating a job.