function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ldiazldiaz 

Process Builder update Record Type

Hi,
I'm trying to create a process to get rid of all my workflow rules, but I am struggling with the fact that I need to set an ID in order to update a record type.

I am forced to set the record type ID, and I cannot select the Record Type Name, like I used to do with workflows.

Process Builder - Record Type Update

I am mising something? Is there anyway to set the Record Type based on the name and not on the ID?

Thanks in advance, Laura
Best Answer chosen by ldiaz
SonamSonam (Salesforce Developers) 
Hi Idiaz, you are right..processes have its limits as is stated in this doc:
https://org62.my.salesforce.com/kA130000000ZgNc?kavVersion=43&lang=en_US&popup=true

@Ravi, you will have to update record Type refering to its record ID as it point as the option to update the record type using name is currently not present.

For the lead conversion question, Process is nothing but a flow at the backend so it should pretty much work like a flow. And the issue seems to be fixed in the flow - the link you've mentioned.

All Answers

SonamSonam (Salesforce Developers) 
hey Laura,  I think  you will have to go with the record tyoe ID as of now - I searched and couldn't find a way to get the record type to update using a record type name instead of ID
ldiazldiaz
Hi Sonam, thanks for your reply!
Since then I've been searching myself and I think there is no way but to hardcode the Id.
Also I found other problems with Process Builder, as it is not bulkified and you hit governor limits with simple operations.
 
Ravi Dutt SharmaRavi Dutt Sharma
Has anyone found a solution for this?
Ravi Dutt SharmaRavi Dutt Sharma
Also does process builder works on lead conversion? 
https://success.salesforce.com/issues_view?id=a1p30000000T3sCAAS
SonamSonam (Salesforce Developers) 
Hi Idiaz, you are right..processes have its limits as is stated in this doc:
https://org62.my.salesforce.com/kA130000000ZgNc?kavVersion=43&lang=en_US&popup=true

@Ravi, you will have to update record Type refering to its record ID as it point as the option to update the record type using name is currently not present.

For the lead conversion question, Process is nothing but a flow at the backend so it should pretty much work like a flow. And the issue seems to be fixed in the flow - the link you've mentioned.
This was selected as the best answer
theDtheD
This is particular frustrating when trying to package Process Builder flows. Having to do an install and then manually clone edit and reactivate every flow is just a mess. Process Builder is so promising but there are so many gaps in it and it seems the author hasn't looked at what the bare minimum is as implemented in Workflows. 
theDtheD
p.s. I ended up doing this all in a trigger since I could easily connect the record type by developer name....
Jo_DengJo_Deng
Is there any update to this? Is there any way to reference the record type label instead of the record type ID in Process Builder? This is sorely needed!
Jo_DengJo_Deng
Found an idea on this, please vote: https://success.salesforce.com/ideaView?id=08730000000Djx5AAC
imAkashGargimAkashGarg
We can use workflow rule for the same. In Workflow we put the record type name.
HijlkoHijlko
If you don't mind to add as many extra fields as you have recordtypes for your custum object, then here is a little workaround:
Create the extra (text) fields in your custom objects, like:
Field_for_RT1 and Field_for_RT2

Create a trigger for your (custom) object something like this

trigger CustomObjectName on CustomObjectName__c (before insert) //Replace CustomObjectName by the real name of your object
{  Id RT1 = Schema.SObjectType.CustomObjectName__c.getRecordTypeInfosByDeveloperName().get('RecordtypeName1').getRecordTypeId(); //replace RecordtypeName1 by the real name of your recordtype
    Id RT2 = Schema.SObjectType.CustomObjectName__c.getRecordTypeInfosByDeveloperName().get('RecordtypeName2').getRecordTypeId(); //replace RecordtypeName1 by the real name of your recordtype
  for(CustomObjectName__c COName : Trigger.new)
 {
     COName.Field_for_RT1__c = RT1;  //here you store the ID of recordtype 1
     COName.Field_for_RT2__c = RT2;  //here you store the ID of recordtype 2
}
}
If you deploy this to a sandbox or production, you don't need to change anything because it get's the RecordType of the sandbox of production
Now you can use the this field as field reference or in a formula where you pick the Field_for_RT.. you need.
Of course you can also use a trigger to change the recordtype when all the required conditions are met. In that case you get the id as mentioned above and in the for section you change it by: COName.RecordTypeID = RT1 (or RT2) and you don't have to make the extra fields