+ Start a Discussion
BobPBobP 

Flow Doesnt seem to find Opportunity ID

I have a new flow where i launch from an opportunity to update selected custom object related records. The opportunity is a master detail relationship with the custom object.  when i click the select custom button on the opportunity instead of just getting the related records to the opportunity I get all records to that custom object. I've tried everything i can think of with this flow to only retrieve the relate records but nothing seems to work. below is a screenshot of my record choice set. Any help with this would be greatly appreciated.

User-added image
Best Answer chosen by BobP
TylerBrooksTylerBrooks
Bob,

I created a Flow that does what you're looking for, mine gets the current opportunity, the yoshin products related to an opportunity, allows a user to select them, then allows the user to update the selected yoshin products (One by one if multiple are selected). I've attached screenshots for you to duplicate.

Let me know if you have any questions:

User-added image
Get opportunity
User-added image 
Get Yoshin Products for that opportunity
User-added imageUser-added image
The collection var to store the yoshin products
User-added image

This will be continued as the image limit is being reached so I'll put it in posts of 5 images each. Note that my field (opportunity__c is the field for the master-detail with the opportunity)

All Answers

TylerBrooksTylerBrooks
Bob,

Have you used a lookup to get an opportunity where the recordId == {!recordId}? where "{!recordId}" is a text variable available for input and output. 

Flow should be something like

>Get Opportunity where opportunity Id equals {!recordId} (If you create a variable it recognizes the the API recordId as the current record)
>Get Yushin Product where Opportunity_name__c equals opportunity (The get Yoshin is in you record choice set you're configuring)

Screenshots below:
First half of get opp
User-added image
User-added image

And here are the variables:

User-added imageUser-added image

If this helps please mark as best answer to help keep the community clean!

Regards,
Tyler
TylerBrooksTylerBrooks
Bob,

Can you take some pictures of your flow and variables for me to look at?

Regards,
Tyler
BobPBobP
I will do that asap.
BobPBobP
Screenshots are below. Basically I'm trying to take this example from Wizardnews post but I'm using Opportunities and a custom product page.

https://thewizardnews.com/2018/06/22/update-only-user-selected-records-from-a-multi-select-list-in-flow/#comment-1761




User-added image

User-added image

User-added image

User-added image

User-added image
 
TylerBrooksTylerBrooks
Bob,

In your record choice set the "Filter Yoshin Product Records" is the issue
User-added image

You need to change the Filter from "Get all Yoshin Product records (No Conditions) to Meets Filter Criteria. Then have the criteria be 
Field = Opportunity_Name__c (Or whatever field is the opportunities Id)
Operator = Equals
Value = {!OppId.Id}

That makes it so the Opportunity Id associated with the Yoshin product record is equal to the OppId.Id field which is the current opportunities Id therefore only showing the current opportunities related yoshin products.

Let me know if you have any more questions.

Regards,
Tyler
 
BobPBobP
Tyler, 
That worked!! my flow is only retreiving records associate with specific Opportunities(THAT"S GREAT!). I'm ruinning into another issue though. After I get records associated with the opp, I have a screen element to update the price field on the product page. After i select the products to update, i click next and my flow goes to the last screen and by-passes the step to update the price field on each product. 

User-added image
User-added image
User-added image
User-added image
BobPBobP
Hi Tyler when i ran my debug on the flow I get this message below.

FAST LOOKUP: Get_Yushin_Products
Find all Yushin_Product__c records where:
Opportunity_Name__c Equals {!OppId.Id} (00618000009HOQFAA4)
Assign those records to {!SelectedProduct}.
Save these field values in the variable: Id, Name
Result
Failed to find records.
TylerBrooksTylerBrooks
Bob, Can you take a picture of what your flow looks like? How its connecting?
BobPBobP
User-added image
TylerBrooksTylerBrooks
Bob,

I created a Flow that does what you're looking for, mine gets the current opportunity, the yoshin products related to an opportunity, allows a user to select them, then allows the user to update the selected yoshin products (One by one if multiple are selected). I've attached screenshots for you to duplicate.

Let me know if you have any questions:

User-added image
Get opportunity
User-added image 
Get Yoshin Products for that opportunity
User-added imageUser-added image
The collection var to store the yoshin products
User-added image

This will be continued as the image limit is being reached so I'll put it in posts of 5 images each. Note that my field (opportunity__c is the field for the master-detail with the opportunity)
This was selected as the best answer
TylerBrooksTylerBrooks
User-added image
Record choice set for that
User-added imageUser-added image

The Loop
User-added image
Make sure you're looping through the collection from the "Get yoshin products".
Here is the loop variable
User-added image
TylerBrooksTylerBrooks
Determine if it's selected - NOTE: YOU MUST USE THE SCREEN COMPONENT THAT YOU HAVE FOR THE RECORD CHOICE SET, NOT THE RECORD CHOICE SET, THE SCREEN COMPONENT IS WHAT DETECTS WHAT IS SELECTED NOT THE RECORD CHOICE SET
User-added image
The screen after the decision
User-added image
What each type is (Using the loop current name shows which yoshin product you're entering info for just as a advisory note to make sure your users know)
User-added image
The update price field - note, I just created a variable for default value, you do not have to at all you can leave that blank.
User-added image
And the update
User-added image
The value for the update is going to be the API name for the number screen component.


Copy this and your flow will work for you, Let me know if you run into any issues.
Please mark an answer as the best answer to help keep the community clean!

Regards,
Tyler
BobPBobP
Good afternoon Tyler,

 I've recreated your flow, but for some reason it is not working. When i activate it and go to the opportunity and click the select product custom button all i get is the first screen with not checkboxes, then click next and it goes right to the last screen. I am getting an a message when i try to debug the flow. 
User-added image
Record Choice Set
User-added image
Record Collection Variable
User-added image

Product Record Variable
User-added image

Opportunity Record Variable
User-added image

 
TylerBrooksTylerBrooks
Bob,

When you're getting your opportunity what is the variable you're using in the condition? The one that should be {!recordId}? Is that available for input and output? If not make sure it is. That's what the message is showing.
BobPBobP
Great success!!!!

That was it Tyler, I did'nt have the recordId field checked for input or output. Once i did that it worked. Thank you so much for your patience in working with me. I really appreciate it. 
BobPBobP
Quick question, Is there anyway to get a rich text field to show the formatting capabilities  like this one in a flow screen? 
TylerBrooksTylerBrooks
Can you provide an example of what you mean?
BobPBobP
Yes. the first screenshot is a typical rich text field in salesforce. The second is what the rich text field looks like when i run a flow. There are no formatting capabilities in the flow text field.

User-added image

User-added image
TylerBrooksTylerBrooks
Bob, This was available in the old cloud flow designer, it's not a feature in flow builder yet.
BobPBobP
Okay, Thanks for you help again!