Excellent point. But one thing I've struggled with unsuccessfully is including RecordType in the entry conditions for a flow. E.g. we have a number of record types on Accounts, each record type holding quite different data (not entirely our fault - most were installed by Salesforce's EDA pack, when we installed that), and to limit the overhead (particularly when uploading large amounts of data), we don't want every flow to run for every record type. But only RecordTypeID is available when setting entry conditions. Any thoughts? Moving the criteria from the entry conditions to a get record as in your video and then a decision element won't work, as the flow will still trigger for all record types, which is what we need to avoid.
Awesome question. I think in those specific scenarios you could try using "Formula Evaluates to True" for your entry conditions and then use the {!$Record} functionality to specify a condition like: {!$Record.RecordType.Name} "Standard" (in addition to any other requirements). This way the ID isn't hard coded and you can still filter out the record types you don't want by using the name.
Even though Flows are not "code" you should still build them like a developer. Not hard-coding Ids is a Salesforce best practice. Users would be well-served reviewing Salesforce's best practices for Apex development, and leverage those for their Flows as well.
So clear, thank you
You're 100% right to make this video to remind everyone about this. Let's try to stay away from Hardcoding as much as possible 🥳
Feels like we all go through hardcoding IDs when first learning flows... ouch. Great walkthrough of how to level up flows!
Excellent point. But one thing I've struggled with unsuccessfully is including RecordType in the entry conditions for a flow. E.g. we have a number of record types on Accounts, each record type holding quite different data (not entirely our fault - most were installed by Salesforce's EDA pack, when we installed that), and to limit the overhead (particularly when uploading large amounts of data), we don't want every flow to run for every record type. But only RecordTypeID is available when setting entry conditions. Any thoughts? Moving the criteria from the entry conditions to a get record as in your video and then a decision element won't work, as the flow will still trigger for all record types, which is what we need to avoid.
Awesome question. I think in those specific scenarios you could try using "Formula Evaluates to True" for your entry conditions and then use the {!$Record} functionality to specify a condition like: {!$Record.RecordType.Name} "Standard" (in addition to any other requirements). This way the ID isn't hard coded and you can still filter out the record types you don't want by using the name.
@@nickfrates Excellent! That's worked.
Even though Flows are not "code" you should still build them like a developer. Not hard-coding Ids is a Salesforce best practice. Users would be well-served reviewing Salesforce's best practices for Apex development, and leverage those for their Flows as well.