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);
if(bloginEnabled ==false || var==true )