Is it possible to add a button that calls the function that

Posted by jsniemi79 on 16-Oct-2014 09:45

I'd like to update the personal setup page to have a button that will reset the user's password.  It looks like the reset password under the more actions section calls a function using rbf_runObjectAction("rbf_userReset").  Is there a way I can run this same function from a button?

All Replies

Posted by Orchid Corpin on 16-Oct-2014 10:13

Hi Jason,

Are you referring to the EDIT page of a user or in a VIEW page?

Thanks,
Orchid

Posted by jsniemi79 on 16-Oct-2014 10:33

I'd actually like to add it to the personal setup page, so tecnically, I think it is an edit page.  That way, they can access the reset under the "Update Profile" link.

Posted by Orchid Corpin on 16-Oct-2014 11:14

Currently there is no functionality for this aside from view page, but you can utilize this workaround.

NOTE: Steps below is a workaround, it was tested and works fine since no hard-coded IDs. Still I suggest to file an enhancement for this.

1. Create a button first > Go to object definition of USER object and create New Button under Button section

2. In New button page specify "Run client-side JavaScript" as the behavior and in the textarea specify the code below. Below section you select the "Personal Setup" or select other pages too. NOTE: once saved you cannot edit in which page it will be displayed.

rbf_runObjectAction('rbf_userReset');

3. In the Personal Setup page add a script component and paste the code below. If button was added to the edit page you specify this code too.

<script type="text/javascript">
	function rbf_userResetConfirmed() {
		window.location.href = '../servlet/Object?act=resetPassword&id={!id}&objDefId={!#OBJ_ID.USER}&destId={!name#url}';
	}
	function rbf_userReset() {
		var dt = 'Reset Password?';
		var dc = '<span class="bold">Are you sure you want to reset the password for {!firstName} {!lastname}?</span><br/><br/><span class="bold">Note:</span> An email will be sent to this user containing a new temporary password (this email is based on the <i>Password Reset Notification</i> User Email Template which can be customized).';

		showPopWin('../dialog/confirmCheckDialog.jsp', 500, 290, rbf_userResetConfirmed, true, dc, dt);
	}
	rbf_addObjectAction('rbf_userReset', rbf_userReset);
</script>


4. Button can be seen together with the other default actions.


Hope this may help.

Regards,

Orchid

Posted by jsniemi79 on 16-Oct-2014 12:23

I've got all that code in place.  It looks the same, the source code looks good when I check it, but I am not getting the confirmation dialog to perform the reset.

Posted by Orchid Corpin on 16-Oct-2014 13:07

Can you check in the console(F12) if there are errors?

Posted by jsniemi79 on 16-Oct-2014 13:09

I did and didn't see any.

Posted by Orchid Corpin on 16-Oct-2014 13:19

Can we have a lync session, so I can see the actual process?

It would help me debug the issue too. Just give me your email address.

Regards,

Orchid

Posted by Orchid Corpin on 16-Oct-2014 16:52

Will send you lync invite as soon as I get your email or you can tell me when would you be available, since in my test it is working perfectly.

Regards,

Orchid

Posted by Orchid Corpin on 23-Oct-2014 14:11

Hi Jason,

Have you made this working already?

Regards,
Orchid

Posted by jsniemi79 on 24-Oct-2014 08:16

Sorry, i haven't yet.  The customer isn't sure if they are going to need this functionality.  I'm waiting to hear back from them. Thanks for following up!

Posted by Orchid Corpin on 24-Oct-2014 09:31

Also if they can reset their own password in the personal setup they will be automatically logout. I suggest to use the "Change my password" instead so that user will not be automatically logout and can still continue its activities. This way new password will take effect after logout.

Regards,
Orchid

This thread is closed