43

The error happens when you're trying to insert/update the record which can't be logically inserted/updated. So basically make sure that: you don't insert/update a record that does not exist, you don't update object field that is build-in/read-only, you perform the action using the user who has not the right access to modify the object More detailed ...


25

When you update the opportunity stage using the Sales Path Component, it shows a toast after the update. You can handle that showToast event and then update your component accordingly. <aura:dependency resource="markup://force:showToast" type="EVENT" /> <aura:handler event="force:showToast" action="{!c.doInit}" />


14

You can use OpportunityLineItem to traverse from Opportunity to PricebookEntry and Product.. something like this query SELECT Id, Name, Account.Name, (SELECT Quantity, UnitPrice, TotalPrice, PricebookEntry.Name, PricebookEntry.Product2.Family FROM OpportunityLineItems) FROM Opportunity WHERE Id = :YourOppId You can also refer this object ...


14

If your organization has Enterprise Edition of Salesforce, you can create a separate Record Type for Opportunity and a Page Layout for that Record type in which the field in question is added. Remove the field from your default page layout then create a Workflow Rule that fires when the Stage that reflects the 90% probability is selected. Create a field ...


13

You can use the OpportunityHistory object SELECT StageName, Probability, Amount FROM OpportunityHistory where OpportunityId = {YourOppId} if you are doing it in Apex, you can use relationship query like this List<Opportunity> opps = [SELECT id, (SELECT StageName,Probability,Amount FROM OpportunityHistories) FROM Opportunity]; List&...


12

Use the IsWon field in your SOQL condition expression. For example, SELECT Id, Name FROM Opportunity WHERE IsWon = TRUE will return all Opportunities with any StageName of Type Closed/Won.


12

The email author URL should look like below. Out of all the parameters I would always use "p3_lkid" and "retURL". Rest of the parameters are optional. Let's break this down: _ui/core/email/author/EmailAuthor?p3_lkid=001E000000CVCF7&retURL=%2F001E000000CVCF7&p2_lkid=003180000066S1e&p4=abc@cc.com&p5=abc@bcc.com;xyz@bcc.com&p6=Hello World&...


12

A great resource for understanding row locking situations is the Record Locking Cheat Sheet (PDF link). Note at the top of page 2 that insert, update, and delete of Opportunities locks the parent Account. Since your batch job is running in parallel across its batches, the batches can independently attempt to gain locks on the same Account, resulting in ...


10

Yes they are the same : Salesforce official doc Name: The opportunity line item name (known as “Opportunity Product” in the user interface).


10

You can use the OpportunityFieldHistory Object for this. List<OpportunityFieldHistory> history = [Select Id, CreatedById, CreatedDate, Field, NewValue, OldValue from OpportunityFieldHistory Where Field = 'StageName'];


9

You want to extract all logic from your trigger and put it in a helper class. This way, you can create one trigger per object and have a good overview of which object triggers what logic. First, you create your helper class with the logic from your trigger: public with sharing class ProposalTriggerHelper { public static void updateOpportunityStage(...


8

Sure thing. You don't even need Apex. Create the following Visualforce Page and you can include it in any Page Layout you wish on the Case object. <apex:page standardController="Case"> <apex:relatedList subject="{!Case.AccountId}" list="Opportunities" /> </apex:page>


8

In order to do this you would use RecordTypes Create the record types for each of the differing account groups Create page layouts to go with each record type Create a WFR to set the record type based on your criteria Assign the Page Layout to the appropriate profile and record type This works well as long as you do not have a bazillion different record ...


8

Follow given steps : Go to the Price Book Entry object Select Search Layouts Edit Search Results Change the fields Press Save


7

Your problem is you are not following best practices for trigger bulkification. Try refactoring your code to remove the SOQL queries from inside the for loops as if your trigger has a volume of records (more than 50) it will blow the query governor limit of 100 queries (as you are currently performing 2 queries per record). Something like below would be ...


7

Not possible, according to the documentation: "All implicit sharing added by Force.com managed sharing cannot be altered directly using the Salesforce user interface, SOAP API, or Apex" http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_bulk_sharing_understanding.htm In order to get rid of this, you need to change the Sharing Rule causing ...


7

So @Monith's answer is correct in that you should use an outputLink tag, but I disagree with the link construction methodology enough to post a separate answer. When you are constructing links for standard actions, you should use the $Action global variable: {!URLFOR($Action.Opportunity.View, opportunity.Id)} If you look through the Valid Values for the $...


7

Since you already have a list of Ids (AcLst) you could query every Opportunity related to those Accounts, then populate a Map using the accountId as key and the list of opportunity as value. Map<Id, List<Opportunity>> mapAccountIdOpportunityList = new Map<Id, List<Opportunity>>(); for (Opportunity o : [SELECT Id, StageName, AccountId,...


6

Opportunity Team Members cannot be created unless you are the owner of the Opportunity or are above the role hierarchy. However, there are two ways you can achieve this: 1) Create a Visual force page and then have the logic to add/delete Team Members 2) Create a custom object and write a trigger on the custom object to add team members. Since triggers run ...


6

Well the SOQL it would be something like this- [Select Id, (Select Id From OpportunityLineItems) From Opportunity] Once you get that, you would have to loop through a list of items under each Opportunity record. Hope this answers your question.


6

since all the areas are already explored , here is a tricky and important suggestion - Please make sure that the version settings of visualforce page and its controller/extension is same. Hope this helps!


6

Here's an option I can think of.. not a straight forward one thou.. (and there might be an easier option that i can't think of) Create a Custom Setting (hierarchy) with a Number field and start with a base value Create a New Custom Number Field on Opportunity and set its default value to read from the Custom Setting field. You can mark the field as Read-...


6

This error is because you haven't added your product to a standard price book. To be used in custom price books, all standard prices must be added as price book entries to the standard price book. More info on Product object So you can modify your code like that: Pricebook2 pb = new Pricebook2(Name = 'Standard Price Book 2009', Description = 'Price ...


6

The OLI fires the Opportunity trigger mainly due to Roll Up summary fields as well as other potential fields SF updates, including the standard Amount field. An update to OLI will always cause Opp triggers to fire and always has AFAIK


6

The problem is that you are calling addError on Trigger.OldMap instead of Trigger.NewMap. When declaring the signature for checkForStageDuration you have it (oldMap, newMap) but when you are passing in parameters in your trigger, you are passing in (newMap, oldMap).


6

This is a good place to apply a semi-join pattern, which is the most common query tool used to limit a query by the presence or absence of related objects. It is made only a little bit more complex here by the fact that Opportunity and Contact are related by a sort of junction object, OpportunityContactRole: SELECT Id, Name, (SELECT Id, Name FROM ...


6

Check out the OpportunityStage object. SELECT MasterLabel, DefaultProbability, ForecastCategory, IsClosed, IsWon FROM OpportunityStage


5

I would like to recommend ready to use Salesforce Appexchange Native App Cloud Drop in order to store any number and size of files that can be associated with any salesforce object. Cloud Drop is one of a smart and excellent native app available which integrated Salesforce with Rackspace. Please check the following link for more information: https://...


5

Try this app - just came up on a call today! I believe this would allow what you are asking to do. https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B4AJKEA3


5

It is a pure business logic. There are different pricebooks for same products. This is because you may have different type of customers for the same product. One customer who purchase in bulk, for him you will have pricebook with some discount. Other customers who don't purchase in bulk you will have pricebook without discounts. There can be other ...


Only top voted, non community-wiki answers of a minimum length are eligible