After Create Trigger Is Not Working on Opportunity converted from Lead After Release 10 Upgrade
Last updated on APRIL 11, 2016
Applies to:Oracle Fusion Sales Cloud Service - Version 22.214.171.124.0 and later
Information in this document applies to any platform.
In Release 9 the customer created a script in order to populate a custom field based on the value of another custom field on the Opportunity page.
The triggered fired on Opportunity creation and established the Sales Method value based on the Segment information. It worked on both scenarios: Opportunity created from scratch and Opportunity created from Lead conversion.
After REL10 upgrade this feature no longer worked when the Opportunity was created from Lead conversion.
From Release 10 onward several new features were implemented. One of the new uptakes was the option to setup multiple business units (BU). Opportunities and Leads support the use of multiple business units. When an opportunity is created from the UI, BU is set to the user's primary BU. The Out Of Th Box code will not perform a defaulting logic here. So the sales method modification in AfterCreate Trigger will work as usual. While converting a Lead to Opportunity, the Leads BU needs to be mapped to the newly created Opportunity. During this BU mapping operation, an additional defaulting logic runs which overrides the defaulting mentioned in Aftercreate groovy script. One such overridden default logic is Sales Method. The OOTB code, sets the converted Opportunity's sales method to the default sales method of the BU. The After Create trigger is actually invoked before the defaulting. So even if the trigger sets the proper sales method, the defaulting resets it. Using BeforeInsert trigger instead will resolve the issue. This is because BeforeInsert method is invoked after OOTB code runs the defaulting logic and just before the Opportunity row is inserted into the Database.
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms