19

Using a Wait (now called Pause) element does preserve the Flow's state, including all of its variables and the field values of queried sObjects, across the boundary into a new transaction. As expected, limits are reset across the transaction boundary. This strategy is more or less explicitly endorsed by the documentation: A transaction ends as soon as a ...


14

The short answer is Yes, absolutely. You can pass variables using the standard HTTP URL parameters. So from the lead page you can have a link to launch a flow and pass the leadID as the following nax.salesforce.com/flow/myLeadFlow?vaLeadID={!ID} where vaLeadID is the unique name of the variable in flow. If you are using a Visualforce Page with a flow ...


12

You can assign a fault connector and screen to any lookup or DML action. This should capture a validation rule...although I'm not sure if it will on update of a child causing a validation rule on the parent. All you need to do is create a screen with a text output that uses the merge field {!$Flow.FaultMessage}: Then connect the action element to the ...


10

It's cleverly hidden in the section titled "Update Active Stages and Collections with New Assignment Operators" in the release notes. Basically, you can use an assignment formula to determine the size of your collection: {!myCollectionSize} equals count {!myCollection} And from there, you can then use that value in conditional controls, etc.


8

Static variables in Apex only retain their value through the course of a single transaction. Future methods by nature execute in a separate transaction, which means that your static variables are reset. You cannot use static variables to return a value from a future method to the synchronous code that called it.


7

I reckon isdtp=vw (the magic service console parameter) should do it.


7

Flow doesn't provide the standard way to add image, but there is a workaround to add image into Visual workflow. Add a Display Text to screen page and enter HTML markup to that text like regular HTML. Visual workflow render all text as html text. Ex: In above image html tag is added to Display text <img src="http://www.wolfgangdigital.com/wp-content/...


7

The system never optimizes triggers or flows of its own accord. You will need need to gather all the relevant ID values and then call the flow. However, you should be wary of using flows in bulk anyways, because they tend to consume a lot more CPU time than simply writing Apex Code. When you call a flow, it runs synchronously, as if you'd just called another ...


7

Flows currently have some pretty serious flaws, including having a very poor execution time (better chance of CPU governor limit exceptions), being harder to optimize (better chance of SOQL or DML governor limit exceptions), and a Flash-based editor that actually makes it faster to write trivial pages in Visualforce and Apex. However, Flows do not require ...


7

First of all, this is an excellent question and I am writing best as per my opinion which can vary with others. Considerations When to do what and what can be supported over other. Process builder works good in following scenarios. Create a record of any object type Update any related record—not just the record or its parent Use a quick action to ...


7

In order to use conditional visibility with custom LWC components, there are two things that need to happen. Dispatch the FlowAttributeChangeEvent when you want to notify the flow runtime that a change has been made. Use automatically assigned variables in the conditions that need to be notified of the change. As per Flow Conditional Visibility ...


7

In short: I managed to do this in Apex by using apex-mdapi AFTER I updated the code to support flowAccesses. - here's the github commit with changes needed to support it. This is the only way I can see to do this through Apex as you need to hit the Metadata API. Very Long Version I didn't see anything within SOQL or Tooling API that can be used. It seems ...


6

You can call an Apex plug-in from the flow: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_process_plugin_using.htm You could run this plug-in without sharing to allow the user to insert/update objects that they do not have access to. Write the plug-in to accept as input all parameters needed to perform the inserts and updates. Then in ...


6

Most of the objects that represent a Flow have key prefixes starting at 300 and going through to 31v. E.g. 300 InteractionDefinition 301 InteractionDefinitionVersion 308 InteractionCondition None of these currently (Spring 14 / v30.0) appear to be accessible via the Partner API, the tooling API, or directly in Apex. They don't appear in the sObjects ...


6

The (attempted) serialization of the not serializable component can be avoided by making the field transient: public with sharing class Sample3 { private transient Component.Flow.Interview flow; public Component.Flow.Interview getFlow() { return flow; } public Sample3() { flow = new Component.Flow.Interview(); flow....


6

You need to add the flow to a visualforce page and enable the page to work in Salesforce1. As long as you are ok with the limited layout possibilities of the screens, you can give flow a try.


6

To invoke a flow from a class and pass in values to the Flow's variables: Flow.Interview flow = new Flow.Interview.MyFlowApiName(new map<String,Object> {'vAccountId' => aId}); flow.start(); // after flow has executed, fetch values from Flow's variables // (assumes flow creates an Order ...


6

You are correct that Flow and custom code can accomplish nearly the same thing, in almost all cases. To cite the Salesforce mantra: clicks, not code -- where you can, you should use a declarative tool before writing custom code. A Flow allows an admin who is unfamiliar with writing Apex the ability to do some pretty complex operations without writing any ...


6

Normally, Process Builder does do short-circuit evaluation on Boolean expressions, so this is an effective way to guard against null references. I tried to reduce this to a minimal example, and the issue appears to be that the ISPICKVAL() function is evaluated before Boolean short-circuiting. A Process Builder with this formula-based condition works ...


6

You can fire an autolaunched Flow using Scheduled Apex, but there's an easier way if you don't have experience writing code. Doug Ayers has a free, open source application called Mass Action Scheduler: Declaratively schedule Process Builder, Flows, Quick Actions, Email Alerts, Workflow Rules, and Apex to process records from Reports and List Views. You ...


6

According to the documentation on Getting Flow Variables, you should call myFlow.getVariableValue: String accountId = (String)myFlow.getVariableValue('accountId');


6

As per the documentation: https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.get_started_supported_experiences LWC is not supported in Visual flows as of now! As mentioned, you can wrap a lightning web component in an aura component, and can use the same in flows, and in many other experiences and tools where LWC is not supported!...


6

To make the components available in flow screens, edit the lightning web component configuration file to include a target of lightning_FlowScreen. For example: <?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>45.0</apiVersion> <isExposed>true</...


6

The InvocableMethod interface is bulkified. This allows you to map flows within Process Builder in a bulkified manner. As the documentation states, your parameter must be... A list of a primitive data type or a list of lists of a primitive data type – the generic Object type is not supported. This means that to pass in a collection, you actually need to ...


6

This is the bug: https://success.salesforce.com/issues_view?id=a1p3A0000003UVoQAM horrible stuff and I hope they put effort into getting this fixed. The only way to edit the flows currently is to hand edit the XML in the package. edit: or on a scratch org. They can be opened there. Flows & Processes are currently inaccessible through the UI on both ...


6

Apex is superior in all three categories for maintainability, scalability, and efficiency. Flows typically take longer to edit than code, do not run efficiently, and may cause problems on bulk updates. If you're given a choice, prefer using Apex when possible. Flows are really only meant for simple logic.


6

Generic SObject and SObject[] are not yet supported at the interface between LWC and Flow (TLDR: You can't get there from here). We're working on it right now, though, and hope to get it into Summer '20. You can get an early taste for some of the experience by looking at how we implemented it for Apex Invocable Actions in Spring '20 We don't have any short-...


6

It apparently runs as the "Automated Process" user. I see mention of it here https://jenwlee.com/2019/10/01/schedule-a-flow/ More importantly, I scheduled a quick flow to test this and I can see through debug logs that the scheduled flow was executed by the Automated Process User as opposed to the user who scheduled it. Scheduled Jobs Debug Logs


6

Salesforce has exposed tooling api that can help you clone the Managed Package flow if it is packaged as template. Note you can wrap this tooling api via an apex class and achieve everything that API can do. To clone the flow via the api follow the below steps. PREREQUSITE : Note that for experiment i have installed a flow package here from appexchange that ...


5

You can embed Flows in Visualforce Pages as you said. This would allow you to upload files as part of a flow. The upload of the Attachment or Document would sit outside the flow in the VF Page, and the ParentID for the Attach/Document you could pull from the Record ID's out of the Flow via the Apex Controller. The Visualforce Pages Controller has access ...


Only top voted, non community-wiki answers of a minimum length are eligible