function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tania B GarciaTania B Garcia 

Doesn´t relate the case to the opportunity

Hi
The email to case was enabled, with this an email arrives to SF and a particular case is created, when the case is created there is a field called Opportunity which I want to relate to the existing opportunity.
Of the case that was created, there is the credit number which a flow was made to find this credit number among the opportunities that exist in SF, but at the time the case was created or an update is made, it is not relating the case with the opportunity even if the credit number of the opportunity exists
In this case, a process builder was made that calls a flow that is the following:
User-added image
The first get, the credit number is searched within the opportunity, which is passed through a variable in the process builder
The second get, the credit number is searched inside the case, which is passed through a process builder variable ´
The set value, the value of the Opportunity Id is set to the Case field called Opportunity
The update, the values are saved in the Case

The process builder
User-added image
In this it is done through the Case when it is created or edited, in the condition it is done by the specific case that is created and that the credit number does not come empty.
Then the flow is called and the value of the credit number is passed to it in the variable

After making these flows so that you put the Opportunity ID in the Opportunity field in Case, when the case is created or edited it does not put anything in the Opportunity field in Case, but the credit number if it exists related to a Opportunity for which I do not understand why it is not relating it and putting the data in the Opportunity field in Case

Could you please help me
 
Best Answer chosen by Tania B Garcia
PriyaPriya (Salesforce Developers) 
Hi Tania,

Kindly follow the below steps :- 
1. In the process builder check if the case is created from email to case.
2. pass the case id in the flow
3. query all the field required from the flow (including the credit number )
4. If the credit number is not null, query the opportunity with this credit number 
5. map this opportunity with the case and update the fields
 

Please mark it as the Best Answer so that it can help others in the future.

Regards,

Priya Ranjan


 

All Answers

PriyaPriya (Salesforce Developers) 
Hi Tania,

Kindly follow the below steps :- 
1. In the process builder check if the case is created from email to case.
2. pass the case id in the flow
3. query all the field required from the flow (including the credit number )
4. If the credit number is not null, query the opportunity with this credit number 
5. map this opportunity with the case and update the fields
 

Please mark it as the Best Answer so that it can help others in the future.

Regards,

Priya Ranjan


 
This was selected as the best answer
Tania B GarciaTania B Garcia
Hi Priya

Well, until now I did the steps you sent me, what I needed to put is the case id, until now everything works correctly and it maps the opportunity to the case that the email to case is created

Thanks and Regards