java - Primavera Integration API cannot create user license -
I am trying to create a user who works like a magic but I do not give him a user license can. I get an error message field object ID is not loaded or set. What field object is not set?
User User = New User (_sessionHelper.getSession ()); User.setName (importResourcesData.getSsoID ()); User.setPersonalName (importResourcesData.getFirstName () + "" + importResourcesData.getLastName ()); User.setEmailAddress (importResourcesData.getEmailAdress ()); User.setPassword (importResourcesData.getSsoID (), importResourcesData.getSsoID ()); User.setAllResourceAccessFlag (wrong); User.setGlobalProfileObjectId (getDefaultGlobalSecurityProfile ()); Object idiid = user.credit (); // Works !!! BOIterator & LT; UserLicense & gt; LoadResources = _sessionHelper.getElm (). LoadUserLicenses (new string [] {"licenseTip"}, "LicenseTip = 'Timesheets'", blank); Islesinaes ul = loadersource.net (); // it fails! User.createUserLicense (UL); Generally speaking, the integration API is structured in such a way that when you create or update a call once, you should not continue using an object. Instead, you should read a new object from the API and use that new object. In your case, you will add something like this after the call to user.create ()
the end user user2 = User.load (_sessionHelper.getSession ()), Tap, user id);
Then you will use user2
in place of the createUserLicense
user
Pre> user2.createUserLicense (ul);
Comments
Post a Comment