Hi, 

I am trying to change password of the user entity and also change the other attributes of the users entity. However, i am unsure whether what i am doing is correct especially for the changing of password. I have attached an oml of what i did, could anyone help to check whether i am doing it correctly? Thanks!

Hi Jolene,

As i saw, in your code user not able to change password because in your code like below image

UserId as input parameter and this input parameter is assgining from changePassword screen and there is no UserId assgin here.

And ChangePassword screen content UserId as input parameter and there is no userID assgin.

So first assign userid for changePassword screent after that your logic will run successfully.


Hope this will help you.

Regards 

Rahul Sahu


Jolene Kwek wrote:

Hi, 

I am trying to change password of the user entity and also change the other attributes of the users entity. However, i am unsure whether what i am doing is correct especially for the changing of password. I have attached an oml of what i did, could anyone help to check whether i am doing it correctly? Thanks!

Looks like something is missing here, how do you arrive at the ChangePassword page? how you're giving the input parameter UserId?



You have a default screen Change password that when you arrive in this page you don't have a UserId you need to assign it first so you can get the proper record or you need to change on your aggregate

Processing Upload...

You check here in this oml the changes.

Another thing I would put this validation or any another validation in the client action SaveOnClick before call the server action

Carlos Lessa wrote:

Jolene Kwek wrote:

Hi, 

I am trying to change password of the user entity and also change the other attributes of the users entity. However, i am unsure whether what i am doing is correct especially for the changing of password. I have attached an oml of what i did, could anyone help to check whether i am doing it correctly? Thanks!

Looks like something is missing here, how do you arrive at the ChangePassword page? how you're giving the input parameter UserId?



Hi Carlos,

So if i remove the input userid and change the filter of the GetUser to "User.id = GetUserId()" ? 

Also thanks for replying but i think there is some problems with your oml, it is still processing upload. If you dont mind, can you help to reupload? I would like to see how you did the changes. Thanks!


Rahul Sahu wrote:

Hi Jolene,

As i saw, in your code user not able to change password because in your code like below image

UserId as input parameter and this input parameter is assgining from changePassword screen and there is no UserId assgin here.

And ChangePassword screen content UserId as input parameter and there is no userID assgin.

So first assign userid for changePassword screent after that your logic will run successfully.


Hope this will help you.

Regards 

Rahul Sahu


Hi Rahul,

I realised my mistake there but just to check my logic for changing password and editing user details are correct? Especially the assigning parts in the logic, i get confused about that the most. 


Jolene Kwek wrote:

Carlos Lessa wrote:

Jolene Kwek wrote:

Hi, 

I am trying to change password of the user entity and also change the other attributes of the users entity. However, i am unsure whether what i am doing is correct especially for the changing of password. I have attached an oml of what i did, could anyone help to check whether i am doing it correctly? Thanks!

Looks like something is missing here, how do you arrive at the ChangePassword page? how you're giving the input parameter UserId?



Hi Carlos,

So if i remove the input userid and change the filter of the GetUser to "User.id = GetUserId()" ? 

Also thanks for replying but i think there is some problems with your oml, it is still processing upload. If you dont mind, can you help to reupload? I would like to see how you did the changes. Thanks!


here it is, let see if this time will be uploaded, related with "User.id = GetUserId()" you will filter the aggregate for the user that is logged and when you try to edit you will edit the right record, before you were editing the wrong record bcuz of that you didn't see results, in this oml I add the name and user id over the form, so you can be sure you are editing the right record


Hi Jolene,

yes i have check in my personal env and its wrok fine.

only change userid and add validation on your client action.


Regards

Rahul Sahu

Rahul Sahu wrote:

Hi Jolene,

yes i have check in my personal env and its wrok fine.

only change userid and add validation on your client action.


Regards

Rahul Sahu

Hi Rahul, 

I tried to change the password, but it still doesn't work. I change the validation part and added the userid according to what carlos did but i still cannot change the password. Any idea what else is going wrong? 


Edited: i realised the issue lies at the if condition of 

SyntaxEditor Code Snippet

OldPassword = GetUserById.List.Current.User.Password

This is because the password in the database is encrypted so it will never be equal to what oldpassword that users key in. However, i want to include the condition of users typing in the correct old password before they can change the password, any idea how to equate the not encryted old password in the database and the old password that users key in? 

Solution