Posts

Showing posts with the label opportunity

Salesforce Fact #893 | OLI insert/update triggers Opp triggers and flows

When an Opportunity Product record is created or during update if certain fields like Sales price/Quantity is updated, it executes the before and after update triggers and flows on related opportunity. So, we need to be careful while creating any automation on Opportunity Product. Reference:  https://salesforce.stackexchange.com/questions/184659/opportunitylineitem-fires-opportunity-trigger

Salesforce Fact #735 | Push count field

There is a field named 'PushCount' in Opportunity object. It keeps track of the number of times the close date of the opportunity is updated with atleast one month difference. In order to enable this field, Go to Setup -> Opportunity Settings -> Select 'Make the Push Count field available' -> Save Reference:  https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunity.htm

Salesforce Fact #734 | Prompt users to add opportunity products

There is a setting under Setup -> Opportunity Settings ->  ' Prompt users to add products to opportunities '  which enables a prompt to the user to add products to the opportunity once it is created.

Salesforce Fact #728 | ContactId in Opportunity

The ContactId field on opportunity is a read-only field and it is not visible in the page layout. This field can be updated only using the IsPrimary flag of the Opportunity Contact Role. Reference:  https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunity.htm

Salesforce Fact #661 | Close related opportunities from screen flow

Image
We can create a screen flow to mark the related opportunities as closed won/lost from the account detail page. Attached are the screenshots.

Salesforce Fact #639 | Filter-based opp territory assignment

In order to use an apex class for filter-based opportunity territory assignment, the apex class needs to implement the  TerritoryMgmt.OpportunityTerritory2AssignmentFilter interface and it needs to implement the getOpportunityTerritory2Assignments() method. Reference:  https://help.salesforce.com/s/articleView?id=sf.tm2_enable_ota.htm&type=5

Salesforce Fact #634 | Validation on opportunity deletion

Image
Suppose we need to keep a validation on Opportunity, an opportunity cannot be deleted if it has existing line items. We can make use of the HasOpportunityLineItem field in trigger. Attached is the screenshot. Note: The code snippet is only for demonstration purpose and apex best practices have not been covered.