1.  对象关系:

PriceBookEntry ——> Pricebook2 --------> Opportunity  ------>  Account

OpportunityLineItem ------->  Opportunity

OpportunityLineItem --------->  PriceBookEntry  -------->  Product2 


2. Trigger

在通过After Insert触发的Trigger里面,不能直接对Trigger.New里面的Record字段进行赋值,如果还要进行对象更新,必须New一下这个对象,并把已经Insert的Id赋值给它,然后做update,否则会报Record is read only 异常。(使用sObject.clone()和List.deepClone()可以很好的解决这个问题);


3. Customer Portal, Partner Portal

* Customer Portal : helps your customer to resolve their queries without contacting customer support rep.

Partner Portal : Your partners can login to your salesforce Org via a website other than salesforce. They are able to see and manipulate data for which you made them authorized.

customer portal is for your customers and Partner portal is for partners.