0

I am looking for a simple way for the user to change the record type of a record. I would like to know if it is possible to have a button on the page layout for the record that the user is working and for them to be able to press this button and to then change the record type of the record, e.g., case. As a result the page layout would change but more importantly the Process flow would then kick in to manage the record. I need a button/action because this is what users prefer as a way of changing the record

4
  • The standard recordtype field allows you to do this
    – Eric
    Jan 31, 2017 at 14:15
  • apart from displaying the record type field on the page layout, whcih we do not want to, do you have an alternative?
    – Bartley
    Jan 31, 2017 at 14:26
  • Lightning or classic? If you are allowing them to change it anyway why go through the extra effort to support a feature so simple as changing the record type when it exists... To each their own. In Lightning you will most likely need to create a lightning action and hobble something together
    – Eric
    Jan 31, 2017 at 15:56
  • Classic first. ot quite ready for Lightning. Its about the UX really, we might need to give a long or ambiguous name to the record type while will lead to confusion for the end user. Instead we are focused on providing a simplified i/face with as much process automation as possible and simple terms exposed to the user.
    – Bartley
    Jan 31, 2017 at 17:14

1 Answer 1

1

In Salesforce classic you can update the Record Type through a OnClick JavaScript button.

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}

// identify the record
var o = new sforce.SObject("Opportunity");
o.id = "{!Opportunity.Id}";

// make the field change
o.StageName = "Closed Won";

// Update the Record Type
o.RecordTypeId = "XXXXXXXXXXXXX"; //You can also Query the RecordTypeId 

// save the change
sforce.connection.update([o]);

//refresh the page
window.location.reload();

Refer this link for more details on OnClick JavaScript button. http://hometeamconsulting.com/update-records-javascript-buttons/

1
  • 1
    Thx Saroj, you mentioned this for Classic, is there something better in Lightning?
    – Bartley
    Jan 31, 2017 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .