Contents
Is it better to write a trigger on opportunity?
There’s absolutely nothing wrong with SalesForceGirl’s solution, but I don’t see the advantage in creating maps when you can just query those fields directly from the opportunity. Simpler is always better imo. You can always refactor later if the need arises.
Is the trigger code correct in Salesforce Stack Exchange?
SalesforceGirl is 100% correct in the trigger code but I would go with a workflow where those are all standard objects and accessible. Managers and admins can edit those easily if need be. Thanks for contributing an answer to Salesforce Stack Exchange!
Is it better to write a SELECT statement in a trigger?
Simpler is always better imo. You can always refactor later if the need arises. If one knows about Salesforces limits and best coding practices you NEVER write a select statement in a loop. Always use in memory maps in a trigger.
What to use in a trigger in apex?
Always use in memory maps in a trigger. If you consult for a client that has numerous classes and triggers like that you’ll never deploy to production without eventually hitting SOQL limits. SalesforceGirl is 100% correct in the trigger code but I would go with a workflow where those are all standard objects and accessible.
When to update opportunity stage based on account status?
I have a trigger that updates/ inserts opportunities when the account is created. This was implemented by a third party. Now I would like to update the opportunities to Cancelled when the Account status= ‘Cancelled’. I have tried this via workflow rules and field update but this did not work.
What’s the best way to create an opportunity stage?
Opportunity Record Types are the way to handle this. Create different record types for each sales process that is different. Then modify the Opportunity Stage picklist for each record type. In other words, only include those Opportunity Stage picklist values relevant to each record type.
How to change the opportunity stage for each sales process?
Create different record types for each sales process that is different. Then modify the Opportunity Stage picklist for each record type. In other words, only include those Opportunity Stage picklist values relevant to each record type. Modify the default Opportunity Stages to tightly reflect the sales process (es) in your business.
How to assign an opportunity in Dynamics 365?
Owner: Indicates the owner of the opportunity. You can assign the opportunity to another user or team. To change the owner, you can select a different user or team in this field or use the Assign button on the command bar to assign it to another user or team. More information: Assign or share records
When to add a price list to an opportunity?
When you add a price list to an opportunity, it helps in automatically calculating pricing of the proposed products that the opportunity is interested in purchasing. At this point in the sales process, you’re most likely in either the Develop or Propose stage. More information: Nurture sales from lead to order
Can you change the currency of an opportunity?
You can’t change the currency of the base record (in this case, an opportunity), unless you remove all the list items associated with the record. Similarly, all the records created from an opportunity, such as a quote, order or invoice must use the same currency as the opportunity.
How are page triggers used in Microsoft Dynamics?
Page triggers allow you to use C/AL code to control the behavior of the system as a result of an event on the page, such as a page opening or a field changing its value. You typically use page triggers for advanced validation and logic. Page triggers can be divided into three categories: General page triggers that apply to the entire page
Why does trigger only work when it needs to?
Here’s another version of the trigger with more guards in it so that it only does work when it needs to – changes to other fields on Account won’t consume queries or DML. The reason to take extra care here is that the Account object can be shared by many apps and customisations in an org, so the trigger logic can pile up.