0

I have Item object to which Opportunity Product object has look up. What I wanted is to add related list to Item with all of Opp Products, but I can't add columns for the fields Account or Opportunity, which are standard fields with FLS set as read/write for all, and accessibility is as required. There is antoher standard field, Product, which I can add and I see no difference between them.

So my question is: what requirements does the field need to meet to be addable to related list?

  • Hi Marcin, this question is a little hard to follow. Could you expand on what your data model looks like and what the issue is? A screenshot might help show where you are in the UI. – David Reed Mar 26 '19 at 19:33
  • 1
    I think it's clear enough. I don't think I can answer it while it's in this queue, but I will say that Account is not a field on OpportunityProduct, so you cannot put it in the related list. Opportunity is, and you should be able to include that. – DavidSchach Mar 26 '19 at 21:10
  • @DavidSchach you are right Account is not there ( my bad XD ) but Opportunity is there and is not pickble. – Marcin Trofiniak Mar 28 '19 at 11:29
  • I've reopened this in light of @DavidSchach posting an answer that's been accepted. It's not the easiest thing to read but the final part is a clear question. – Matt Lacey Apr 8 '19 at 1:27
2

To add a field to a related list, it must either: 1. Be on the child object itself 2. Be on a (different)parent record to that child object where the relationship from child to (different) parent is master-detail.

Account is not on the OpportunityProduct object, so you won't see it in the related list. You should see Opportunity, though. If you don't see that as an option, that is surprising, but the relationship between OpportunityProduct and Opportunity on the back-end in Salesforce is not standard. It was the part of the first-ever double master-detail roll-up summary field, allowing OppProd -> Opp -> Account, and as such, the platform dev team had to do a lot of work with it.

I hope this helps somewhat.

For a workaround, put a formula field on Opportunity Product that displays the Opportunity Name, and another that displays the Account Name. Then you can put both on the custom object's Opportunity Products related list.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.