Activity Forums Salesforce® Discussions How to create junction object records using Salesforce Apex code?

  • Radhakrishna

    Member
    July 26, 2017 at 5:38 am

    Hello Aman,

    The PriceBookEntry object is a hidden junction object so you can't add fields to it. When a Product is added to the Pricebook, this record is created.

    You might be able to get close to what you want using Validation Rules on the OpportunityProduct object. Since PriceBookEntries are used to associate a PriceBookEntry to an Opp, you could have a VR check that the OppProduct.UnitPrice is within some limits of the PriceBookEntry.Product2.ListPrice.

    This would only really make sense if your Min/Max prices follow general rules like +/- 10%.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos