on 2016 May 26 1:37 PM
Hi,
The original user is unable to login into CLM when a delegation is set for the user who is inactive or Enable user to login button is unchecked. For testing I created a delegation in which user is inactive and login checkbox is unchecked. So, each time I am unable to login (as I am the original user here). I have made changes in the script because manually it is not possible to internally set the login functionality. Need help in fixing the logging functionality of original user even if delegated user is inactive or with login flag disabled.
currentUser = session.getAccount().getAccountObjectReference();
usrIbean = IBeanHomeLocator.lookup(session, currentUser).find(currentUser);
delegateUserObjRef = doc.getExtensionField("Z_DELEG_APPR").get();
delegateUserHome = IBeanHomeLocator.lookup(session, delegateUserObjRef);
delegateUserBean = delegateUserHome.find(delegateUserObjRef);
bloginEnabled = delegateUserBean.getFieldMetadata("CAN_LOGIN").get(delegateUserBean);
var=delegateUserBean.isInactive();
if(bloginEnabled ==false || var==true )
{
usrIbean.getFieldMetaData("CAN_LOGIN").set(TRUE);
}
-Avneet
Hi Avneet,
To set any field of the Bean first upgrade it to edit using upgradeToEdit() on that bean.
Also the syntax of setting value using getFieldMetadata should be
bean.getFieldMetadata("Field Name").set(bean,java.lang.Object value) ;
After setting the value ensure you save the bean and downgrade it to view as below.
Homebean.save(bean);
Homebean.downgradeToView(bean);
Please check if this helps.
Thanks & Regards,
Rajiv Yadav.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.