You need to sign in to do that
Don't have an account?

Lookup Record ID in Flow for use in Dynamic Choice
Does anyone know a good way to query and set the 15 byte RecordType ID in Flow to be able to assign it to a variable for use in a dynamic choice?
I have a lookup element that queries 'RecordType" for a record where DeveloperName == 'Client' and SobjectType == 'Account' to set the vaAccountRecordTypeID == id HOWEVER it sets the variable as the 18 byte string and when I use it as part of my criteria for the Dynamic Choice it does not return any choices. I then hard coded the 15 byte GUID for the RecordType id to the variable and it does find the record. I really dont want to have to hard code this value. I was also trying to see if there was a way to
Left(vaAccountRecordTypeID,15) in a text template to then set that as vaAccountRecordTypeID but had no luck getting that to work.
Has anyone found a way to overcome this shortcoming in VisualFlow. It would be nice if you can just use the developername and SobjectType when defining the dynamic choice.
OK, so the only way we were able to get around the issue, was to write an Apex Plug-in
All Answers
I'm not familiar with the limitation you are referencing, but we've been using RecordTypes as Dynamic Choices for a while.
So I'm clear though, you are actually trying to do a dynamic choice on another object and you are filtering based on the record types? So you are saying something like "Contact Record Type = vaRecordTyhpeId" and displaying all relevant Contacts (or whatever the object is)?
Yes, I have to query the RecordType object to return the Record Type ID for Accounts with a Record Type of 'Client' (DeveloperName) to then use in my Dynamic Choice to only return Account of that Record Type. However, it expects the 15 byte version not the 18 byte version
I just tried to create a dynamic choice with the following criteria
SObject equals Case
id equals 012D00000007AuiIAE
as well as:
SObject equals Case
id equals 012D00000007Aui
In both the cases, the dynamic choice worked correctly...
A good way is to log into the org using tools such as SOQL explorer (on mac) or the IDE to get the IDs and make sure there match correctly
It doesn't work for me. If in the dynamic choice I hard code Account Record Type == '012700000005bVu' It works, but If i do a record lookup that assigned the looked up record type ID to a variable, it doesn't work. In my case the look up assigns a value of '012700000005bVuAAI' to vaAccountRecordType
Settings for Record Look up:
Lookup: RecordType
DeveloperName == 'Client'
SobjectType == 'Account'
Sets id = vaAccountRecordTypeId
That will return 012700000005bVuAAI
If on the Dynamic Choice I use the hard coded '012700000005bVu' I get results in my Dynamic Choice and when I replace the hard code with the variable, I get noting. The variable is is both Input/Output and set to a Data Type of Text.
I tried Hard Coding 012700000005bVuAAI (18 byte version) into the Dynamic Choice and got the same results as using the variable, which is nothing.
Actually, I think it's unique to the use of RecordTypeId's in Dynamic Choices, because I've updated existing records after a lookup and have successfully created records many times. When it comes to narrowing down a Dynamic Choice to a specific record type, I've always had to hardcode the "short" ID for the Record Type and unfortunately you cannot filter your recordtype in a Dynamic Choice using the Developer Name by putting in something like RecordTypeID__r.DeveloperName == 'Client'
OK, so the only way we were able to get around the issue, was to write an Apex Plug-in
I know that this has been marked as SOLVED, but did anyone consider just passing the RecordTypeId into the flow in the URL used to launch it?
He's talking about getting the Ids and doing the lookup inside the Flow. The record type isn't known when person launches the Flow. He wants them to pick it when inside the Flow.