Skip to main content TDX, the developer conference for the AI agent era is happening now. Watch live on Salesforce+ for exclusive digital content, a revolutionary keynote, and more.

#Change My Password토론 중인 항목 0개

Hi everyone, recently I had a tricky requirement to solve in Salesforce Experience Cloud. I was preparing this material some time ago and wanted to share here for who can benefit from it.

Requirement:

Send an email everytime the user finishes reseting the password in an experience cloud portal site 

Problem: 

Salesforce doesn't trigger an event by password set up, only when the reset password form is filled.

The LastPasswordChangeDate field doesn't fire apex triggers, record triggered flows or platform events with detailed payload in case they exist.

Restrictions:

Salesforce only sends email when the user asks to reset password in the reset password page.

The field LastPasswordChangeDate can not be used to trigger a flow, platform event or apex trigger as well as some other standard fields like LastLoginDate so we can not rely on this standard field to fire some process to send the email.

Solution:

The solution involves Scheduled Jobs, Custom Field, Email Template and Custom Settings

  • Create a new custom field to mimic the standard LastPasswordChangeDate in the User object so we can rely on it to compare the last changed password date.
  • Create a new email template to inform the user that his password was correctly set up. 
  • Create an apex scheduler class that will runs from every n minutes to check if the password was changed from the latest n minutes to now. 
  • Create a Custom Setting to store this n minutes so it can be changed manually later by a salesforce admin. 

Explanation:

If the new field is null in the first execution, set it to be the same value as the current LastPasswordChangeDate If the standard LastPasswordChangeDate field is bigger than the new custom field, it means the password was changed, so we can send the email

After that we set the new field to have the same value of the standard field, so it will fire only once as needed.

Abort the job and reschedule itself to run in the next n minutes, so you will always have only one instance of the pending job to run and not hit the 100 queued jobs limit.

Doing this way we avoid filling the jobs pending queue which has a small limit compared if we are setting all the jobs needed to run throughout the day.

For a more detailed explanation and code reference, I stored everything in this repository on GitHub: https://github.com/JonasLopesdoO/SF-Password-Reseted-Email-Send/tree/main

 

#Experience Cloud  #Salesforce Developer  #Email Template  #Change My Password

0/9000

I have users that have gong to My Settings -> My Personal Information -> Change My Password but the right-hand side of the page is blank. However, when I login as the user the page displays.

 

The user is using the Firefox Browser (we do not have Chrome) on company computers.

 

Is anyone else seeing this issue? Any resolutions of thoughts?

 

Thanks in advance.

 

#Blank Page #Change My Password #Lightning 

댓글 4개
0/9000