I am writing a trigger for the object OpportunityLineItem to set for all new records the field section__c.
trigger setsection on OpportunityLineItem (before insert)
{
for (OpportunityLineItem opp: Trigger.new )
{
opp.section__c=
}
}
I want set the field section__c for all new record with the value of the field SectionID of the first record of another object named SectionopportunityProduct Object SectionopportunityProduct has ever just one record.I want get the value from this.
There isn't a relationship between opportunitylineitem-SectionopportunityProduct. How can I do this?
Thanks in advance for any advice. BR