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
Jessica SuboczJessica Subocz 

How to create a custom button to trigger a flow

Hello, 

 I have spent the last three days muddling through flow builder and process builder, red everything I can find on my issue, but still find myself lost and unable to complete my task at hand.

I am attempting to create a custom button to trigger a flow and process. The end result would be an automated process to re-open leads and create activity logs among other things. I need the custom button to trigger the flow, which will trigger the process. I am fairly new to this sort of thing, and thanks to COVID working remotely isn't ideal either. So far I have created a field which would be toggled true/false once the button is pressed, which would then trigger a flow. However, when I attempt to use the new checkbox field but when creating the flow, I don't see my new checkbox field as a choice to use for field conditions. So I can't figure out how to toggle the checkbox if I can't actually find it in the fields??

Many of the trailblazer comment threads seem to end in catch-22s - either Chatter is the answer which we don't use, or Javascript, which doesn't work in Lightning, etc. 
 
Any help would be greatly appreciated!
ShirishaShirisha (Salesforce Developers) 
Hi Jessica,

Greetings!

You can simply invoke the flow using the custom button instead of Invoking it whenever the checkbox is checked.Otherwise,if you are requirement to invoke the flow whenever the checkbox is checked instead of clicking the Custom Button then you would need to write the criteria in the flow to get the record if the checkbox is true only.

You can use this document (https://trailhead.salesforce.com/en/content/learn/projects/flow_calculate/flow_calculate_implement) to create custom button to invoke the flow directly.

Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Jessica SuboczJessica Subocz
Thank you for your prompt reply! I just realized that I'm probably not explaining myself in proper terms. I created the field for the checkbox, but it's not visible in the screen layouts, only in the back end, which I want the flow to check off, and then trigger a process. I am unable to create the initial flow, because I can't seem to access the checkbox field that I created as a condition for record update. (This is all rather new to me, and I'm still learning the vobac and semantics , so I apologize if I'm not being concise!) I need assistance creating the flow I think.
ShirishaShirisha (Salesforce Developers) 
Have tried to check with the API name of the new checkbox that you have created on the Object.Also,please add the newly created field on the pagelayout on which you are to view the field on the record page.

Thank you!
Jessica SuboczJessica Subocz
The checkbox is not intended to be visible on the page layout, only on the back end to trigger the flow. The custom button would ideally trigger the checkbox to change from false to true, at which point the flow would initiate. I did it both ways, with the checkbox field showing on the page layout and without, and neither way seems to make it available to use for field conditions. I attached a screenshot.
Md Raza 6Md Raza 6

I am not sure about this Let me know If you want me to confirm this

You Can Read Every Government Yojana Here My Hindi Guide (https://myhindiguide.in/)

Jessica SuboczJessica Subocz
I was able to resolve the issue finally, thank you.