cancel
Showing results for 
Search instead for 
Did you mean: 

Creating User in CLM Using Scripts

0 Kudos

Hi ,

I wanted to know if it is possible to create an user through Scripts . If there is any standard IAPIs present for this purpose in CLM , please let me know and the method name used to create the same else if there is any other alternative solution to this , please try to share the same .

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member190023
Contributor
0 Kudos

Hi,

Yes this is possible. Go to Ref Guide and check out api NewUserAccountIBeanHomeIfc. You will find the create() method which will return a new UserAccountIBeanIfc.

Bogdan

0 Kudos

Thank You for your reply ,

I find that there are three create() methods in  NewUserAccountIBeanHomeIfc . It would be helpful , if you let me know which is apt method .

IBeanIfccreate()
          Method create.
IBeanIfccreate(int typeId)
          Method create.
IBeanIfccreate(java.lang.String docType)
          Method create.
former_member190023
Contributor
0 Kudos

You should use the no-args create().

Bogdan

0 Kudos

Hi Bogdan,

when i tried using create()

i get following error

Sourced file: inline evaluation of: ``import com.sap.odp.api.usermgmt.masterdata.UserAccountIBeanIfc; doc.setDispla . . . '' : Error in method invocation: No args method create() not found in class'com.sap.odp.api.usermgmt.masterdata.UserAccountIBeanImpl'

former_member190023
Contributor
0 Kudos

Hi Amar,

I think the log is very clear ... you are calling create() method from UserAccountIBeanIfc class... it doesn't exist there.

As you also mentioned before, create() method is in NewUserAccountIBeanHomeIfc so you should use that.

Bogdan

0 Kudos

Hi Bogdan ,

Actually i want to create a user with user id and other mandatory fields in CLM User Account .

I was able to find the class called UserAccountIBeanIfc with the help of which i can set all the required fields . Now i am confused as how to create the user . It would be great if you share a sample code or some link regarding the same .

Thanks in advance.

former_member190023
Contributor
0 Kudos

Hi Amar,

The system itself is designed using an MVC approach. In your case, UserAccountIBeanIfc is the model; the controller being NewUserAccountIBeanHomeIfc. I'm not sure, but if you don't have any Java experience these might not make any sense.

As detailed in the initial post the create() method will return your new user bean, so basically you'll need to:

// initialize your controller/home

NewUserAccountIBeanHomeIfc userHome =  IBeanHomeLocator.lookup(session, NewUserAccountIBeanHomeIfc.sHOME_NAME);

// create your new user bean

UserAccountIBeanIfc newUser = userHome.create();

Bogdan

0 Kudos

Hi Bogdan ,

This completely worked ! Thanks for your valuable help

former_member227405
Participant
0 Kudos

Hi Shukla,

Could you please tell, how you are using user details which will be getting fetched  in script?

Just I want an idea so That I can go forward to make in my setup also.

Thanks

Sonu

0 Kudos

Hi Kumar,

I was getting the details of the user from Oracle Identity And Access Management . I received the data via Web Services of CLM and incorporated those data via script to create a User. To create a User please check the post that is marked as Answered.

Create a newUserIBeanHomeIfc ,

Then using the create() method get the UserAccountIBeanIfc

finally use setters of UserAccountIBeanIfc to set various required values.

Once all the above steps is done Use save(IBean) method of newUserAccountIBeanHomeIfc to save your user details.

In case of any queries please let me know ,I will be happy to help .

Thanks,

Amar Shukla

former_member227405
Participant
0 Kudos

Hi Shukla,

Could you please tell me what are the mandatory value of setter value I need to provide like First name,Last name email.  etc.. ? and how  did you set the security profile to give  user level authentication.

Because Once I try to create new user manually then some other mandatory filed like Company ,

other information like Time zone,currency  ....

Please kindly provide your feedback.

Thanks

Sonu.

0 Kudos

Hi Sonu,

For other informations like Time Zone , currency We've set it to default value on UI Level. Other than these the mandatory values are location , First Name , Last Name , Username , Email address for which you can use setter from the API UserAccountIBeanIfc.

I did not code for Security Profiles since my requirement was not to assign any security profile when user is created via scripting (Security Profile was added manually as per the request raised) . However , you can explore on the method addToGroup for your requirement.

former_member227405
Participant
0 Kudos

Hello Amar,

Thank you so much fro your response.

So One User get created then Under security profile automatically set as Application User?

And if required we can go for adding the Group name in the Group Section.

Thanks & regards

Sonu

Answers (0)