Hot answers tagged

8

To enable quote to opportunity sync'ing you have to set Opportunity.SyncedQuoteId to the quote id you want to sync with. From salesforce docs: public void startQuoteSync() { Opportunity opp = new Opportunity(); opp.setId(new ID("006D000000CpOSy")); opp.setSyncedQuoteId(new ID("0Q0D000000002OZ")); // Invoke the update call ...


8

I've found a solution by experiment (with a hat tip to @KeithC, who got me speculating on a productive path), but I don't understand why it works/the direct path doesn't work. I would be happy to accept an answer from anyone who's able to help me understand the principle behind the behavior. I was able to successfully complete the quote generation and ...


7

It may seem simple and I'm sorry if I'm wrong, but I suspect you haven't enabled quotes for your org. It is not enabled by default, you have to manually do this step to use quotes. Setup -> Customize -> Quotes -> Settings -> Enable Quotes


7

Your issue is you are using quotes in two places for two conflicting use cases As RecordsetVar ​<apex:page controller="QuotePageController" recordSetVar="quotes"> As Getter in controller public void getQuotes() { QuoteList = new list<Quote>([SELECT Id, QuoteNumber, Name, Status from Quote WHERE Status =: StatusPickvalue]); } ...


6

There's no need to depend on organization data, and this just a Bad Idea™. Instead, create a new product, attach it to the standard price book, create a new opportunity with the standard price book, then create a new quote, and finally, a new quote line item. Regrettably, you still need SeeAllData for the price book. Example forthwith: Product2 pr = ...


6

You can take help from below: controller : public with sharing class QuoteController { public Quote q {get;set;} public string qName{ get; set;} public QuoteController(ApexPages.StandardController sc) { q = new Quote(); q = (Quote)sc.getRecord(); } public Pagereference saveQuote() { q.name = qName; q.opportunityid = '0069000000OaWIM'; ...


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 ...


5

QuoteLineItem does not have a direct reference back to OpportunityLineItem. The Product and Schedule Objects ERD shows the relationships. While both objects have a Lookup to PricebookEntry that does not relate them in a way that would allow you to get from QuoteLineItem to OpportunityLineItem, since on PricebookEntry could be related to multiple ...


5

Service Contracts represent (per the doc) customer support agreements (warranties, subscriptions, Service level agreements) Service Contracts typically surface within Service Cloud interactions. Contracts are more like a B2B contract between you and a customer. They surface more in connection with closed won Opportunities in Sales Cloud. In one of my ...


5

Since Summer 14, it's been possible to Create Price Book Entries in Apex Tests irrespective of the state of SeeAllData: Id pricebookId = Test.getStandardPricebookId();


4

You can't do that. A web server can give the browser a clue about the filename of the downloaded PDF using the "Content-disposition" http header. But you can't provide a local folder name this way. Which makes sense if you think about it. Here we're talking about a web server trying to tell a browser where to store stuff on the user's drive. Not a good ...


4

It should work with an after insert trigger on the quote object. You check in the trigger if the quote meets your criteria and you also have the opportunity id which you can use to follow this method to get it synced http://hisrinu.wordpress.com/2012/03/28/syncing-quotes-using-apex-5/


4

You have used inputText instead of inputField. For lookup add Id in value. And you have to add all required fields in your vf page. Use the instance you created on your controller i.e. Record in your value as described below. The same you have to do for your other page. -----Vf Page ---------- <apex:page standardController="Order" extensions="Orders" ...


4

You need to reference the lookup field. Contact represents the relationship, which is always null in a trigger (you can query for it if you need it). The field you need to check is ContactId.


4

There are few thing which should be considered when using Contract:- Contract are signed for Organisation and signed by Contact of the Organisation. Opportunity can be associated with one Contract. Contract is parent of Opportunity. Once the Contract is activated it can be deleted or cloned but not deactivated. Order are also can be Activated and ...


4

In a parent query , you can use a child sub-query, formally known as a Left Outer Join: SELECT Id, (SELECT Id FROM QuoteLineItems) FROM Quote WHERE ... As a separate query: SELECT Id FROM QuoteLineItem WHERE QuoteId = :parent.Id


4

The getContentAsPDF call operates in a separate transaction. So if you make that call from within the transaction that sets up the data, that getContentAsPDF call will not see the data at all as the transaction that sets up the data won't have committed. Making two sequential calls from the Lightning Component - one to setup the data and then after that one ...


4

The Subscription Term on the Product and Quote are controlling different things. On the product, this is saying that a subscription product is priced at X cost for that term. If you have a product with a subscription term of 12 months and quote it on a Quote for 3 years, CPQ needs to take the 12 month price x 3. It is possible that you could select a ...


4

You have to enable quotes. The sfdx-project.json file has to have IsQuoteEnabled set.


4

One Pricebook can have multiple Pricebookentries for the same Product2. Example Pricebook2: MyCustomPricebook Product2: MySKU PricebookEntries MyCustomPricebookId MySKUId USD 10.00 MyCustomPricebookId MySKUId EUR 9.50 MyCustomPricebookId MySKUId GBP 8.85 PricebookEntry is a junction record between Pricebook2 and Product2; each instance given the same ...


4

The getContentAsPDF call works in a separate transaction, and as the transaction it is called from has not yet committed, the data is not visible. Hence the need to break this up into two sequential transactions. See e.g. Isolation (database systems). It is a pity this isn't clearly called out in the documentation; instead it is implied via this: ...


3

The $ is definitely not used here; $User is just a special globally available mergefield. I think you may have better results if you display that second line using an apex:outputField instead of a <P> tag, like so <apex:outputField value="You are viewing the {!Quote.Name}" /> Check out this documentation on working with standard controllers ...


3

Have you looked into the apex:relatedList tag yet? https://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_relatedList.htm If this is not a solution for you, please share your full VisualForce page. I think you've only copied the last two lines. You'll have a add a where-clause in your query based on the ID that you pass to the class in ...


3

Visualforce pages cannot reach out of their namespace using apex:include or apex:composition (this applies to both managed packages and the unmanaged c context) To do this we must leverage either a data model relation, or a global Visualforce Component, or an Apex controller class that pulls in the rendered page using PageReference.getContent()


3

As @PeterKnolle pointed out, there isn't a relationship. Fortunately, there is a Force.com lab packages out there that can let you sync custom fields from opportunity line items to quote line items, we've been using it for a while without any major issues. It's rough if you look at the code, but considering the lack of maintenance it's very effective and ...


3

The reason it's because a Quote Object is always related to an Opportunity via a master relationship. It's a bit like Opportunity Product, you can't create a publisher action for that object too. I'm not sure what's your business logic, but you might create your publisher action on your opportunity instead, and with some logic redirect you to the right ...


3

With API version 40.0 , there is new "OpportunityLineItemId" field which tracks the opportunity line item the quote line item is created from. https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_quotelineitem.htm You can now easily create "before insert" trigger on QLI to pull any custom fields from OLI. I have something ...


3

It's located in an object called QuoteDocument. The Document field contains the binary data (encoded in Base64), while the rest of it contains some basic information, like the total, quote ID, and so on. You'll need to pull this file out using the data loader, as it appears that the standard export doesn't include this data (at least, not by default). It ...


3

One way to guarantee a child would be to query against the child object. SELECT PricebookEntry.ID FROM QuoteLineItem WHERE PricebookEntry.Product2Id IN:P2Valid LIMIT 1


3

You have a large number of issues with this page, but I believe I see your main issue. You are grabbing the first gmod__Opportunity_Forecast__c that your query brings up whether it is related to the quote or not. You likely need to add something like AND Quote__c = :cIid list<gmod__Opportunity_Forecast__c> opflist = [Select id ,Name ,...


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