I am struggling with the following task:
1) I need to create a custom button "Close the status", that closes the status for the Case and
2) it should be located at the same position as on the picture below (location of the Close the ticket).
I have tried different things:
- I created a quick action that just updates the record with a pre-defined value of the Status - Closed. It works, but it is located in the Chatter. I disabled the Feed Tracking for Case, Quick Actions moved to the Highlight Panel, as I wanted... but the Chatter disappeared, which we still need to have.
I tried to create a Custom Button with a Display Type - Detail Page Button, Behavior: Execute Java Script, with a Content Source: OnClick JavaScript with the following code:
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} var p = new sforce.SObject("Case"); p.id = "{! Case.Id }"; p.Status = "Closed"; result = sforce.connection.update([p]); location.reload(true);
This code works good and it changed the status of the case in one click, but...only in Classic. I don't see it in Lightning :(
I tried to create a custom button with Display Type - Detail Page Button, Content Source - URL and with:
/{!Case.Id}/s?retURL=%2F{!Case.Id}&cas7=Closed
Closes the status but only in Classic.
All custom buttons I put into the page layout for the custom button placeholder, but I don't see them at the Lightning Experience at all.
I am Beginner in Apex and Visualforce pages, but I have a feeling maybe it is possible to create a custom button with Apex or Visualforce.
If someone had the same problem with the Close the Status button, could you please tell me the direction? Is it possible to create a custom button with Apex or Visualforce? What are the steps?