Skip to main content
Craig Munster (MSA) a posé une question dans #Flow

I have a screen flow that I'd like users to be able to access two different ways: from a field on the Opportunity Product object, as well as a Detail Page Button. What's paramount is where the screen flow returns at its end: I need it to end on a view of the product related list on the related Opportunity record. I got it to work successfully on the field version. Here's my formula field:  

 

HYPERLINK("/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product" &"?recordId=" &Id &"&retURL=/lightning/r/Opportunity/" & OpportunityId & "/related/OpportunityLineItems/view", 

"CLONE", 

"_self" 

) 

 

But for the life of me, I can't get the Button version of the URL to go back to the Product related list. I figured out that I can't reference the Opportunity Id via merge field in this scenario, so I created a formula field called Opportunity_Id__c, which just utilizes a CASESAFEID version of the Opportunity Id.  

 

In order to save time, here is a list of the various versions I've tried that DON'T work:  

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id}&retURL=/{!OpportunityLineItem.Id

} 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id

}&retURL=/lightning/r/Opportunity/&OpportunityId&/related/OpportunityLineItems/view 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id

}&retURL=/lightning/r/Opportunity/OpportunityLineItem.Opportunity_Id__c/related/OpportunityLineItems/view 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id}&retURL=/lightning/r/Opportunity/{!Opportunity.Id

}/related/OpportunityLineItems/view 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id

}&retURL=/lightning/r/Opportunity/{!OpportunityLineItem.Opportunity_Id__c}/related/OpportunityLineItems/view 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id

}&retURL=/lightning/r/Opportunity/&OpportunityLineItem.Opportunity_Id__c&/related/OpportunityLineItems/view 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id}&retURL=/lightning/r/OpportunityLineItem.Id

} 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id

}&retURL=/lightning/r/{!OpportunityLineItem.Opportunity_Id__c}/related/OpportunityLineItems/view 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id

}&retURL=/lightning/r/&OpportunityLineItem.Opportunity_Id__c&/related/OpportunityLineItems/view 

 

 

Anyone have any thoughts, tips, or suggestions?  

 

#Flow  #Flows  #Screen Flow  #Formulas

5 réponses
  1. Aujourd’hui, à 01:26

    @Craig Munster

     

     

    Ah, that's the missing piece — and you're right, I was wrong to steer you off your formula field. On an Opportunity Product button the native OpportunityId genuinely isn't exposed in the merge-field picker (annoying known quirk). Your Opportunity_Id__c CASESAFEID field is exactly the right workaround, so keep it — custom fields DO show up under Insert Field. Just reference that one instead of OpportunityId: 

     

    /flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

    OpportunityLineItem.Id

    }&retURL=/lightning/r/Opportunity/{!OpportunityLineItem.Opportunity_Id__c}/related/OpportunityLineItems/view 

     

    That sends them back to the Products related list on the parent Opp. Sorry for the runaround getting there! 

     

    If this helps, please mark it as the Best Answer so it helps the next person — thanks 🙂

0/9000