Wednesday 25 May 2016

How to check an app is console or not in custom button Salesforce

Here is the scenario, 

Let’s consider, I have created a custom button called “Submit Data” in Opportunity object and I placed this button in detail page of the opportunity layout.

When if I clicked “Submit Data” button from the Console app, then “Page1” (VF Page) should open, else “Page2” (VF Page) should get opened. 

Ensure the followings, before place the below code in a button,

1. Behaviour – Execute JavaScript
2. Content Source – OnClick JavaScript

  1. {!REQUIRESCRIPT("/support/console/28.0/integration.js")}
  2. if(sforce.console.isInConsole())
  3. {
  4. srcUp('/apex/Page1?isdtp=vw');
  5. }
  6. else
  7. {
  8. window.open('/apex/Page2');
  9. }

Reference:

Activities: Assign Tasks to a Queue Salesforce Lightning

Salesforce announced to assign Tasks to a Queue beginning from Spring'20 release. How does it work? In Setup, enter Queues in th...