Hot answers tagged

8 votes
Accepted

IsSyncing test class quote

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 =...
8 votes

STANDARD_PRICE_NOT_DEFINED, No standard price defined for this product: []

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....
  • 2,101
8 votes
Accepted

Programmatically generate Quote PDF in Lightning Component Apex controller

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 ...
  • 88.2k
7 votes

STANDARD_PRICE_NOT_DEFINED, No standard price defined for this product: []

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();
7 votes

VF compile error: standardsetController - void.Id

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 ...
  • 63.8k
6 votes
Accepted

Create new Quote using Apex class

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 ...
  • 2,227
5 votes

Does Quote Line Item reference back to which OLI it relates to?

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 ...
  • 28.8k
5 votes

What really is a difference between Contracts and service Contracts

Service Contracts represent (per the doc) customer support agreements (warranties, subscriptions, Service level agreements) Service Contracts typically surface within Service Cloud interactions. ...
  • 63.8k
4 votes
Accepted

Unable to save records in Order and Quote through Visualforce page

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 ...
  • 470
4 votes
Accepted

Validate Contact name on Quote object

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.
  • 445k
4 votes

Relationships of Opportunities, Quotes, Contracts and orders

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. ...
  • 22.3k
4 votes
Accepted

SOQL query to retrieve Quote Line Item records from Quote Record

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 ...
  • 144k
4 votes

How to use Test.getStandardPricebookId for classes that automaticaly sync quotes

Create a custom price book, set is as active (IsActive=true) and use it. If you are using a price book entry, then make sure standard entry is created before the custom one. This is because a standard ...
  • 41
4 votes

Programmatically generate Quote PDF in Lightning Component Apex controller

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 ...
  • 131k
4 votes
Accepted

Create Package Version Error: Entity Quote not found

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

Pricebook and PricebookEntries with different currencies

One Pricebook can have multiple Pricebookentries for the same Product2. Example Pricebook2: MyCustomPricebook Product2: MySKU PricebookEntries MyCustomPricebookId MySKUId USD 10.00 ...
  • 63.8k
4 votes
Accepted

Creating quotes - code just stops running with no errors

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 ...
  • 131k
3 votes

Trigger Validation on QuoteLineItem Based on Quote Status

The reason you are not seeing the error is because the addError needs to be on one of the QuoteLineItem records from the trigger context, which are the records that the save is been done on. See ...
  • 12.2k
3 votes

How to remvove header from first page while rendering as word(doc) file

Try this @page:first{ @top-right { content: "" font-weight: lighter; font-size:8pt; } }
3 votes

Wrapper Class is not Fetching the Correct Child records values on Visual Force page

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 ...
  • 6,069
3 votes

Quote Document size

I believe if you setup your specific salesforce instance URL under the Remote Site Settings you should be able to utilize the HttpRequest/HttpResponse classes in Apex to call out to REST. The REST ...
  • 743
3 votes

float table to bottom of PDF?

You should define the @page size and footer style like this: <apex:page showHeader="false" renderAs="pdf"> <head> <style> @page { size: 21.0cm 29.7cm; margin-...
  • 21.7k
3 votes

How to get the Quote Name displayed in a visual force page

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 <...
3 votes
Accepted

How to populate related list records in VF page for Editing?

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

Can i call One Visual force page into another Visual force page which is in PDF

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 ...
3 votes
Accepted

Does Quote Line Item reference back to which OLI it relates to?

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, ...
3 votes
Accepted

Add Publisher Action to Quote page layout

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'...
  • 5,518
3 votes

Does Quote Line Item reference back to which OLI it relates to?

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....
3 votes
Accepted

Detect Quote PDF generation at the Quote level

Here's one possibility that comes to mind if you were to write a trigger on Quote. There's no Quote History object, but there is the Quote PDF's related list that may have some kind of impact on the ...
  • 40.5k
3 votes

Quote Trigger Initial term of field expression must be a concrete SObject: Boolean at line 32 column 89

The map function containsKey returns a boolean value. But you try to get the Quotes out of it. You should use get function of map. Change this for(Quote existingQuote : mapOfOpps.containsKey(qRec....

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