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
HaroldHarold 

Opportunity Split Object Trigger

Is it possible to write a trigger on the Opportunity Split Object?

Sonam_SFDCSonam_SFDC

Hi,

 

AFAIK one cannot create a trigger on Opportunity Split object but you can create a trigger on Opportunity and acess the Opportunity Split on that opportunity using SOQL.

 

Wondering what exactly is the use case you wish to implement...would like it if you can share what you are trying to achieve.

 

ericthgirwericthgirw
I was wondering the same thing. My reason is that my org has FinancialForce and all our commissions come out of FF instead of SF. So I created an object off the Sales Invoice for tracking the splits of an opportunity, utilizing standard split controls for forecast use as well. I'd like to trigger off the Sobject OpportunitySplit instead of the Opportunity because my integration team update my opps all the time and I don't neccissaryly need to do 2 SOQL calls every time a Opp is updated but rather when the Opp Splits are updated by the sales / acct man teams. Just because the Opp was updated doesn't mean I need to run a check to see if the splits were updated so I can sync those records with FForce.
ericthgirwericthgirw
I just created a batchable / scheduleable class that syncs all opps = sales invoice once or twice a day depending on the day. I'd like for it to be as real time as possible for my sales team and I think the trigger on the OppSplit object would be the best place to ensure its updated correctly every time the splits were updated without spending all the extra querys in lookups.  
HaroldCHaroldC
I ended up like ericthgirw and created a batchable class that syncs every night.  However, the other option I came up with was to create a custom object to mimic the opporunity split object.  Add it to the related list and remove the standard opportunity split.  Then create a trigger on the custom object that keeps the standard object in sync.  So when they add or modify a custom split you update the actual opp split.  That way you can write all your triggers on the custom object and only update the opp split when you need to.
jjohan1.3968912454758625E12jjohan1.3968912454758625E12
Sonam, when user update/create in Opportunity Split, and our trigger located in Opportunity, will trigger in Opportunity Trigger catch it?
CNishantCNishant
As per the new release, we have the functionality to write trigger on opportunity splits.