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
Carlos Tasayco SilvaCarlos Tasayco Silva 

Update an opportunity field with the same data from product field

Dear Friends,

We are trying to implement a new opportunity field based on a field from product object. Basically in product we have a field where is the brand of the product (A,B,C), however we need this field in the opportunity object because we are trying to implement a new field which will depend of the brand but because the brand is not in opportunity object we cannot do this.

I look forward hearing from you soon.

Warm regards
Best Answer chosen by Carlos Tasayco Silva
Sai PraveenSai Praveen (Salesforce Developers) 
Continuation ...
User-added imageUser-added image

If this solution helps, Please mark it as best answer.

Thanks,
 

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Carlos,

As per my understanding  you want a field to be copied from product to opportunity. But we usually have multiple products for the opportunity . In this scenerio which product it should consider?

Thanks,
 
Carlos Tasayco SilvaCarlos Tasayco Silva
Hi,

Thanks for your fast response, you are right the field from Product is the brand, it means I don't want the name of the product, in the company we only sell 3 brands (A,B,C). Basically I want in opportunity 3 fields as Brand_A (yes,no), Brand_B(yes_no) and Brand_C(yes_no), if in the opportunity we are selling 2 of the 3 brands I would expect this: Brand_A YES, Brand_B NO and Brand_C YES. 

The field BRAND is already done in Product object with only those 3 options.

Warm regards
mukesh guptamukesh gupta
Hi Carlos,
  • First you need to create a Picklist Name Brand on Product with option Like Brand1,Brand2, Brand3.
  • Second you need to create formula field on Opportuity Line Item That will get Associated product Brand.
  • Third you need to craete 3 formula fields on opportunity object  that's will fetch Opportuity LineItem formula field.

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Carlos,

By writing a record trigger flow on opportunity line item we can copy that from product to opportunity . Please find the below.

User-added imageUser-added imageUser-added imageUser-added imageUser-added image

Continuing  in another comment as maximum no of images exceeded.
 
Sai PraveenSai Praveen (Salesforce Developers) 
Continuation ...
User-added imageUser-added image

If this solution helps, Please mark it as best answer.

Thanks,
 
This was selected as the best answer
Carlos Tasayco SilvaCarlos Tasayco Silva
Hello thanks for answers, I am trying to do the trigger flow ( I have never done this), I am having this issues:

1. I am inserting here Record, Opportunity ID, Opportunity ID (I don't know if is correct) please could help me with what exactly I should insert here.
User-added image

2. My flow ends in this way, not like you are showing:

User-added image

3. When I run, this warning appears 
I appreciate your help
User-added image

I lok forward hearing from you soon guys.

Warm regards
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Carlos,

Try to use the Auto Layout Beta version while creating the flow. 

User-added image
 
In update record the opportunity id should be equal to Record->Opportunity->id as shown below.

User-added image

Once you save the flow we have to activate it . Let me know if you need any other clarifications.

If this solution helps, Please mark it as best answer.

Thanks,
Carlos Tasayco SilvaCarlos Tasayco Silva
Hello Sai,

Thanks for your help, Apparently I did all what you are explaining, however I am seeing the same mistake:
User-added image
My flow now is similar than you:
User-added image
Maybe the fields I created are wrong:
- Marca is a picklist in object Product
User-added image
- Marca A,B,C  are text fields in opportunity product and opportunity objects
User-added image
- The same in opportunity
User-added image

I look forward hearing from you soon.

Warm regards
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Carlos,

The flows seems to be good now. Can i know if the flow is activated? if activated now try to update the product value picklist and check this fields need to be updated in opportunity. Just we need to activate the flow.

Thanks,
K. Sai Praveen Kumar
Carlos Tasayco SilvaCarlos Tasayco Silva
Hello Sai,

Definitely is activated
User-added image
The option of the picklist in the Product Object:
User-added image
In the rest as I mentioned, I have created 3 new fields as I am showing here:

User-added image

I don't what can i am  doing wrong.

Thanks 
Carlos Tasayco SilvaCarlos Tasayco Silva
Hello, It works the problem was that I was using my 3 fields as text fields, but should be a checkbox, now it works. Thanks