You need to sign in to do that
Don't have an account?
Tasia Demuth 4
Can you call a flow from a List button for an opportunity product
Is it possible to
1.create a list button on the related list for opportunity products
2.call a flow from that list button.
This is the visualforce page I constructed, but it says that List Controllers are not supported for OpportunityLineItem. If this is the case, is there any way around this, where I could have a list button that allows me to take action on multiple opportunity line items from within the opportunity?
<apex:page standardController="OpportunityLineItem" lightningStylesheets="true" tabStyle="OpportunityLineItem" recordSetVar="AllOpportunityLineItems">
<apex:repeat value="{!AllOpportunityLineItems}" var="row" rendered="false">
{!row.id}
</apex:repeat>
<flow:interview name="Opp_close_lose"
finishLocation="{!URLFOR($Action.OpportunityLineItem.Tab, $ObjectType.OpportunityLineItem)}">
<apex:param name="recordId" value="{!Selected}"/>
</flow:interview>
</apex:page>
Let me know and thank you in advance for your help!
Tasia
1.create a list button on the related list for opportunity products
2.call a flow from that list button.
This is the visualforce page I constructed, but it says that List Controllers are not supported for OpportunityLineItem. If this is the case, is there any way around this, where I could have a list button that allows me to take action on multiple opportunity line items from within the opportunity?
<apex:page standardController="OpportunityLineItem" lightningStylesheets="true" tabStyle="OpportunityLineItem" recordSetVar="AllOpportunityLineItems">
<apex:repeat value="{!AllOpportunityLineItems}" var="row" rendered="false">
{!row.id}
</apex:repeat>
<flow:interview name="Opp_close_lose"
finishLocation="{!URLFOR($Action.OpportunityLineItem.Tab, $ObjectType.OpportunityLineItem)}">
<apex:param name="recordId" value="{!Selected}"/>
</flow:interview>
</apex:page>
Let me know and thank you in advance for your help!
Tasia
It is impossible to use recordSetVar with OpportunityLineItem so you cannot create the button to choose the products for your flow directly with the standard related list of products.
The products have to be selected in your flow with a dynamic choice or with a new VFP.
The button that launchs the flow Opp_close_lose is on the opportunity (parent object).
Adding and Configuring a Dynamic Choice:
https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_implementation_guide.meta/salesforce_vpm_implementation_guide/vpm_designer_elements_screen_dynchoice.htm
Using a dynamic choice to select multiple records in visual workflow:
https://goravseth.com/using-a-dynamic-choice-to-select-multiple-records-in-visual-workflow
All Answers
It is impossible to use recordSetVar with OpportunityLineItem so you cannot create the button to choose the products for your flow directly with the standard related list of products.
The products have to be selected in your flow with a dynamic choice or with a new VFP.
The button that launchs the flow Opp_close_lose is on the opportunity (parent object).
Adding and Configuring a Dynamic Choice:
https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_implementation_guide.meta/salesforce_vpm_implementation_guide/vpm_designer_elements_screen_dynchoice.htm
Using a dynamic choice to select multiple records in visual workflow:
https://goravseth.com/using-a-dynamic-choice-to-select-multiple-records-in-visual-workflow
If someone has this solution with a javascript button, that could be very interesting for your problem.
https://developer.salesforce.com/forums/?id=906F000000091pGIAQ
The call of the flow itself is easy in javascript but you need to pass the selected products (Ids) .That is the problem.
Probably possible but that is not a recommended solution anymore (that will never work in Lightning if it is a javascript button).
The dynamic choice is working so far. I tested it as a button on the opportunity and will now write the code for the list button.
Thanks again!
Tasia
I was ready to help you for the next steps (that was just the principle) but you are stronger than I myself in building sophisticated solutions with flows. Your questions are not easy and diverse. You help me to make progress too (as far as I can, I remember my failure for your question on analytics. I passed a superbadge Einstein Analytics Data Preparation Specialist that would have helped me at that time for your problem, very rare questions on analytics here excepted yours).
Thank you very much for your feedback and congratulations for your flow (certainly very fine).
Best regards
Alain