Do something before logout in salesforce apex? - salesforce

Is it possible to customize or override the salesforce logout method in apex? I want to do some thing custom when user goes to logout salesforce account.
enter image description here

You screenshot shows the standard logout link which can not be customized.
You can customize the "logout" flow in a community using custom code by having a custom logout link which calls a controller action which wraps the standard logout function but this is only in a case where you are not using the standard header and can implement a custom link for logging out.

The logout flow of salesforce is a standard anchor tag call with a href to a link. If you inspect the element you can see that.
Logout
Unfortunately, there is no controller where the control comes after a click of the LogOut option. The only way you can get some control is, if you customize your logout URL and make salesforce redirect to it after it logs itself out. In that way, you can solve the branding issues but can not do anything related to the user as the user context is lost as soon as salesforce logs out itself.
Though in the idea forum there are ideas for doing that but looks like Salesforce is not doing anything in that front.
Hope this helps.

Related

Is the any way for Next-Auth with google provider to invoke pop-up window instead of redirect to another page?

I am trying to implement google authentication but the requirements of the projects says Pop-Up window login instead of redirect. Is there any solution like uxMode="popup"?
I think there is not an available option, but I was wondering if there is a work around.

Can I switch my default editor to Snowsight?

I login via SSO and it loads up the classic UI. After SSO login I'm sent to specific url like https://company.us-east.snowflakecomputing.com/console#/internal/worksheet.
Is it possible for me in Snowflake to change my default editor from classic to Snowsight so it automatically loads after the SSO login? I'm not an Admin.
It is possible to change Default Experience under Profile:
Yes, this feature is available where the default landing UI would be
Snowsight instead of the current Classic UI. Please reach out to Support team to get more details on this.
Assuming there's nothing in your SSO setup to prevent this, if you log in using the following URL pattern, it should take you to Snowsight instead of getting there from the classic UI:
https://app.snowflake.com/<REGION>/<ACCOUNT>
Your sample URL will take you to the classic UI. To change it, go from this:
https://company.us-east.snowflakecomputing.com/console#/internal/worksheet.
To this:
https://app.snowflake.com/us-east/company
You just need to start with the correct URL for Snowsight on your account, rather than the URL for the classic UI, which us what you are showing in your question
Unless your set-up is unusual (and not pure SSO) then SSO doesn’t change URLs - it just returns you to your original URL once you have logged in.

Best options to display a popup for angularjs app based on conditions

I have an angularjs app with ASP.NET WebAPI2 REST APIs. There is a scenario where I have a display a popup for initiating a survey for end users (both authenticated and anonymous types). On clicking the popup options, the user will be redirected to another applicaiton which captures all the responses provided by the user.
There is no relation between the angularjs app and the survey application.
Now next time if the user revisits the application then in that case based on the previous action taken to fill the survey , I have to take a decision to display or hide the popup for the user.
I thought of cookies and localStorage as the options but I think are not ideal choices for this scenario.
Can anyone help me to know are there any other possible options to handle this scenario?
You can solve this using the redirection link.
For example if he finished correctly the Survey you will redirect him to:
www.myapp.com/survey/success
Than in the App you can do something like: get the URL parameters, if the parameters is success store it on localStorage so next time he revisits the web-page the Popup wont show.
Otherwise direct him to:
www.myapp.com/survey/
I think the best option here is to save this information in the database using your ASP.NET WebAPI2 REST APIs. In the moment that the end user clicks the survey you can also make an Api call which will save in the database info about user's action(this will probably be sth you can do for authenticated users). For not authenticated users you can just save that information in localStorage in the moment they are clicking the survey.

Pre-populate recipients list on Docusign for Salesforce Lightning

I know this feature is available for the old Salesforce UI, but couldn't find anywhere how to pre-populate recipients using Docusign Lightning component.
Has anybody been able to solve it?
With SalesForce "classic" you could use a JavaScript button to prepopulate recipient info when the DocuSign Envelope is created. However, it appears that SalesForce Lightening does not support JavaScript buttons.
To customize "Send with DocuSign" behavior in SalesForce Lightening, you might try the following approach:
Create a Visualforce page that launches an APEX class controller that opens a URL.
Create a class to define that controller.
Create a new action on the opportunity and associate the Visualforce page to the action.
Add the Action to the appropriate area on the Opportunity page layout.
You can find a code sample for this type of implementation on this thread in the SalesForce Developer forum: https://developer.salesforce.com/forums/?id=906F0000000BWr4IAG. And, this other SO post shows an attempt to implement this approach to customize the Send with Docusign behavior: Customize "Send With Docusign" in Salesforce Lightning.
Note: I'm not a SalesForce developer and this answer is simply recommending an approach that others seem to have used in the scenario you've described.

Lightning experience deep link to custom Visualforce tab

Do you know if it is possible to deep link a custom tab on the left hand navigation?
In my web app I allow the user to login through SSO from Salesforce ( so I use salesforce as authentication provider ), than when the user credentials are ensured i redirect the user to the tab using an aspex url like the following:
https://{domain}/apex/{VisualforceTabsName}?sfdc.tabName={VisualforceTabsRef}
or a servlet integration link like the following:
https://na15.salesforce.com/servlet/servlet.Integration?lid={lid}&ic=1&linkToken={linkToken}
I got those links simply right clicking the tabs and copy the link, now this is not going to work on the new ligthening experience where the link is something like the following;
https://gs0.lightning.force.com/one/one.app?source=aloha#{token}
Now it seems to me that the token in this case is user specific, so it can't be used as high level reference to the Visualforce tab.
Do you know if there is a way to do the same in the Lightening Experience (Spring 16' release)? Or if there is a different way to achieve the same result?
Thanks
In Lightning Experience, you can reference custom tabs using the developer name of the tab (note that this is the API name of the tab containing the Visualforce page, not of the page itself). This URL should work:
{domain}/lightning/n/{tabName}
This assumes that you have already created a tab for your Visualforce page.

Resources