raguv12ps
4 years agoAce
Automate Endpoint
I'm trying to run an endpoint automatically to assign roles to users in community by communicating with salesforce through Rest API. It uses the users community email to fetch appropriate roles from ...
cblown I decided to run this on each user login, so we can remove the batch process which has some serious limitations.
Instead of adding the logic in Page init script which can slow performance on each page load, I added a custom component inside the main header (Added on all pages) and triggered an ajax request to hit the endpoint in background. This way the sync happens if the user views any page or even refresh.
I also added a timer to 1 hour and the endpoint gets triggered only if it crosses 1 hour limit. The performance was better when tested.