ahmedabad salesforce meetup
TRANSCRIPT
![Page 1: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/1.jpg)
Lightning Process Builder &
Apex FlexQueue
Ahmedabad - June 20th, 2016
![Page 2: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/2.jpg)
Agenda• Process Builder
• Demo of Process Builder
• Invocable Methods Demo & Best Practices
• Apex FlexQueue
• Questions
![Page 3: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/3.jpg)
Process BuilderWhat is it and how does it help
![Page 4: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/4.jpg)
What is Process Builder?• Introduced as part of the Lightning Framework “a point and click tool for
automating business processes” sits under Workflow & Approvals.– Similar to Workflow…
• Processes driven by users manipulation of Records• Workflow Actions Email Alerts, Approval, Field Updates
– But much more…• Actions can be Immediate or Scheduled• New Actions, Manage Child Records, Post to Chatter,
Call Flow, Call Apex
![Page 5: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/5.jpg)
What is Process Builder?Next Generation Workflow New Actions
Workflow Rules
Multiple “Rules” in 1 processMore FlexibilityGraphical Interface
![Page 6: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/6.jpg)
Process without Programming
• Built for all Admins - from beginners to advanced
• Easy edit lets users respond quickly to business changes
• Creates a shared canvas for IT and the Business to collaborate
Needs updated screenshot
Add powerful actions with a single click
![Page 7: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/7.jpg)
Process Builder Demo
![Page 8: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/8.jpg)
Process Builder Use Case• Create related Child Records
– “Create a Contact when an Opportunity is Closed”• Update records
– “Keep Contacts address in sync from Account”• Post to Chatter
– “Update Opportunity won on Chatter”
![Page 9: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/9.jpg)
Invocable MethodsIntroduction & Code Examples
![Page 10: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/10.jpg)
What are Invocable Methods?• When standard Process Builder Actions are just not enough,
do I have to stop using Process Builder?
• A means to extend Process Builder with Apex! *– Have developers think about exposing ‘actions’– Consider packaging actions for greater reuse
* It is also possible to extend the Salesforce Visual Flow tool in the same way. Invocable Methods can also be called Salesforce REST API, e.g. mobile clients
![Page 11: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/11.jpg)
Invocable Method Example A
NOTE: None void return types from Invocable Methods are supported, but are not of interest to Process Builder.
![Page 12: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/12.jpg)
Invocable Method Example B
NOTE: Note use of label and required variables enhance the Process Builder UI for the end user
![Page 13: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/13.jpg)
Invocable MethodsDemo
![Page 14: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/14.jpg)
Invocable Methods Best Practices
![Page 15: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/15.jpg)
Invocable Methods Best Practices *• Single Invocable method per apex class.• Not available via Triggers• Must be static & public/global• Parameter/ReturnType with data-type :
Primitive data type or a list of primitive data type List of sObject type – generic sObject not supported. List of user-defined type
• Once added in package, can’t remove from later versions.• Make use of label, description and required annotation
attributes to make your methods more accessible to end users of Process Builder
![Page 16: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/16.jpg)
Process Builder Hot Topics• What are the limitations on deleting a process ?• How Can I move processes from one org to another ?• Formula Limitations ?• How do I know which automation tool to use ?• Can I create Task with Process Builder ?
![Page 17: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/17.jpg)
Resources• Community Blogs featuring Process Builder and Incovable Methods
– Lightning Process Builder and Invocable Methodshttp://bobbuzzard.blogspot.co.uk/2015/02/lightning-process-builder-and-invocable.html
– Extending Lightning Process Builder and Visual Workflow with Apexhttp://andyinthecloud.com/2015/03/01/extending-lightning-process-builder-and-visual-workflow-with-apex/
– The Revolution !! Invocable Power - Spring 15http://andyinthecloud.com/category/process-builder/
– Controlling Internet Devices via Lightning Process Builderhttp://andyinthecloud.com/2015/01/31/controlling-internet-devices-via-lightning-process-builder/
– Process Builder Workflow Automation Grouphttps://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000001rzc
• General Gotchas
– Process Builder Bulkification issue with field expressionshttp://www.tquila.com/blog/2015/03/09/bulkify-lightning-process-builder
– Salesforce Process Builder Known Issueshttps://success.salesforce.com/issues_index?tag=Process%20Builder
![Page 18: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/18.jpg)
Recap• Go Faster with Process Builder!
– Reduce Implementation Time• Many use cases previously only possible with Apex Triggers now
possible with clicks not code via Process Builder
– Developers and Admins Working Closer Together to automate more!
• Think about ways to extend Process Builder via Invocable Actions
– Opportunities to create Libraries of Invocable Methods to share• Invocable Methods can be packaged
![Page 19: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/19.jpg)
Apex FlexQueue
![Page 20: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/20.jpg)
Before :\
Which Options Do We have ?
@future
@Batch Jobs
Schedule Jobs
![Page 21: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/21.jpg)
Limitations of Asynchronous Process
Waits for salesforce resources
No Job Id
Only Return Void
Parameters must be primitive
@futureCan’t order jobs
Only 5 active jobs
Batch
![Page 22: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/22.jpg)
And Now :
Flex Queue
![Page 23: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/23.jpg)
Flex Queue Add-On
More than 5 apex jobs in Apex Jobs Table
5 Jobs Processing + 95 Jobs holding
New UI to monitor & manage Jobs
Reorder the holding apex Jobs
![Page 24: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/24.jpg)
Apex FlexQueueDemo
![Page 25: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/25.jpg)
![Page 26: Ahmedabad Salesforce Meetup](https://reader035.vdocuments.mx/reader035/viewer/2022062522/587198281a28ab044e8b512f/html5/thumbnails/26.jpg)
Thank you