This is a new take on my earlier project Reloadable Visualforce Lightning Component, whose purpose was to provide a way to display a Flow on a Lightning Record Page and have that Flow dynamically sync itself with any data changes made on the page.
That first project cobbled together a myriad of concepts, and although functional, it still didn’t render the Flow in Lightning Runtime π¦
With Winter ’18Β we now have the <lightning:flow> component. We no longer need an <iframe> or Visualforce page to embed our Flow!
Demo
Get the Component
Installation instructions are available on the project page.
Techno Mumbo Jumbo
Although this version is nicer because no Visualforce, iframes, or fancy messaging are necessary to make it work, I’m not able to use the <lightning:flow> component in my markup as the one liner I had hoped it to be. I ran into an issue where once the flow was started, telling the flow to start again had no effect. Not being able to force the flow to restart (which in turn causes its first element to fire and load any data again from the database) on demand defeats the purpose of this project.
I brought up my use case to product management in the org62 group Lightning Components – TrailblazersΒ to find out if this is “by design” or if we can get a way to force the flow component to restart.
As workaround, I dynamically create the lightning:flow component in my JavaScript helper and add it to the page. Same end effect, just not as smooth as I was hoping for.
Nice one, I’m going to build up a post of all of the declarative tools like this. The prefix being that everyone is a workaround until an idea is delivered.
I am 100% for using standard functionality. Just sometimes our needs are impatient.
LikeLiked by 1 person
Thanks, glad you like it!
I would say most my projects are trying to fill feature gaps and then Salesforce eventually comes along and delivers.
I’ve found product management to be very receptive and responsive and tries to deliver what they can in response to customer needs.
Thanks,
Doug
LikeLike
Thank you Doug, Your solution has helped me π
LikeLiked by 1 person
Glad to hear it, Edith! Thanks
LikeLike
This was a Fantastic find, thanks Doug for this! It helped me fill the gap I had in my solution π
LikeLike
Doug Ayers, I am getting some issues while deploying into production , while i deploy into sandbox, there is no error, could you please help me with it
ERROR:
Deployment CompleteTest failure, method: CeligoOpportunityLineItemTest.testAddOLI β System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, iPaas_Score_on_Oppty: execution of BeforeInsert
caused by: System.ListException: List index out of bounds: 0
Trigger.iPaas_Score_on_Oppty: line 7, column 1: [] stack Class.CeligoOpportunityLineItemTest.testAddOLI: line 66, column 1
Test failure, method: TestTaskTrigger.TestmethodTestTaskTrigger β System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out stack (postal_io)
Test failure, method: testTriggers3.leadConvTest β System.Exception: Assertion Failed: Expected: testing, Actual: null stack Class.testTriggers3.leadConvTest: line 17, column 1
LikeLike