[SalesForce] Winter ’20 Flow features causing errors during migration

I created two new flows using some features in the new and improved Lightning Flow tool.

One of them uses the new Scheduled start – which lets you select a group of records to start with and run some logic against them. Works great, passed UAT, time to move between sandboxes to run the next level of testing.

Every time I had any reference to the $Record that Salesforce uses to reference the records queried in the Start element, I hit the following error during deployment:"This flow can't reference $Record because its trigger type is null. Change the trigger type, change the flow global variable, or remove the flow global variable from this flow."

I'm not sure how exactly to interpret that at all – only the third option, to remove any and all reference to the $Record global variable seems to have worked.

Has anyone else run into this problem that knows what this error means or how to resolve?

Similarly, I tried to take advantage of the fact that Salesforce now automatically creates a variable for you to store records you find in a Get Records step in my other flow, and referenced those variables. Once again, the logic worked fine and even my complex logic flow passed UAT. When it came time to migrate though, I kept getting "Because the queriedFields field is set, you also need to set the following fields: sObjectOutputReference." Manually setting all the variables rather than using the ones created automatically seemed to resolve this.

Any advice there?

To sum up, I'm looking for any advice or documentation around the new Flow features recently released.

–November 12 '19 update

Update for anyone who hits this error: the "This flow can't reference $Record because its trigger type is null. Change the trigger type, change the flow global variable, or remove the flow global variable from this flow." error comes when you don't have a Start time set up but are referring to $Record. You can see this error if you take a Scheduled flow that makes use of the reference to $Record, and attempt to change it to an auto-launched flow.

In my case, we were seeing these errors because we were using the Copado deployment tool, and that tool wasn't using the new Start metadata. We were able to fix the error by deploying using ANT and making sure to grab the Start/Flowstart metadata mentioned here as part of the deployment package.
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_visual_workflow.htm

Best Answer

Turns out if I make the flow inactive, then deploying the package, the error went away. (this is from SFDC support)

Related Topic