Questions tagged [pricebook]

Represents a price book that contains the list of products that your org sells. Price books are represented by Pricebook2 objects.

Filter by
Sorted by
Tagged with
18
votes
4answers
8k views

SeeAllData=false and Pricebooks

When writing test cases with SeeAllData=false, you cannot access or insert Pricebooks. Effectively this means that you cannot use SeeAllData=false when working with any test case involving products. ...
10
votes
1answer
24k views

Get Standard PricebookId in Apex Class

I have a situation where I was querying standard pricebook with SeeAlldata=true in test class. Pricebook2 pb2 = [select Id, Name, IsActive from PriceBook2 where IsStandard=True LIMIT 1]; Later I ...
10
votes
2answers
5k views

Why there is no OWD settings for Product Object

I was wondering why there is no OWD settings for Product Object. And as it was said that PriceBookEntry is a junction object for Products & ProductPortfolio then why there a OWD settings option ...
6
votes
1answer
3k views

How to get Pricebook2 Sharing Rules using UserRecordAccess

I have an Apex class with sharing where I get a list of every Pricebook2 available in the database. Considering the fact that we use sharing rules to prevent access to some of them, my SOQL shouldn't ...
5
votes
3answers
14k views

How to query the products in standard price book based on StandardPrice

I am using the standard price book for the order ,but my standard price book contains same product with different standard price.How to query the products in standard price book based on the Standard ...
5
votes
1answer
4k views

Pricebook and currency

We have set-up products with a USD and CND price. We have multi-currency set-up in SFDC. When I set an opportunity to USD and select products, it all works fine. But when I set the opp to CND, no ...
5
votes
2answers
3k views

Is it possible to add products to an opportunity using the standard price?

Salesforce wants me to choose a price book in order to add products to an opportunity, but our organisation has opted not to use price books because we never deviate from the standard price. However ...
4
votes
2answers
6k views

Is it possible to default a pricebook based on the recordtype?

Is it possible to set default pricebook based on recordtypes. We have recordtypes like sales and sevice. So when an user selects sales recordtype we should have sales pricebook as default and service ...
4
votes
2answers
5k views

Test code for the new standard Order object

The last line insert ordPd causes exception: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Price Book Not Set on Order: [] All lines before the ...
4
votes
2answers
2k views

Junction object in Salesforce

What kind of relation should a junction object have with it's parent objects? What I know from Salesforce documentation: The junction object should have master-detail relationships with the parent ...
4
votes
1answer
2k views

Invalid field Pricebook2Id for SObject Order. Can't set Price book for Order

I want to insert the OrderItem object using Order, Pricebook2 and PricebookEntry. I retrieved the standard Pricebook2 and inserted an Order and pricebookentry. At the time of inserting the "OrderItem"...
4
votes
2answers
2k views

Consideration when cloning a product?

When cloning a product record, which one of the following statements is true? Price book entries must be activated Price book entries in price books that user does not have access to will be created ...
4
votes
2answers
2k views

How can I tell if a product has an entry for the standard pricebook?

I have VF page from where i i trying to add products to a pricebook. IF the standard pricebook of the product not active then i am getting an error 'DML exception: Standard price not defined'. So how ...
4
votes
2answers
710 views

Summer 14 and Price books [closed]

Since Summer 14 released this weekend every time I try and clone a product I get the below error message and I don’t understand what its saying? I think something changed with the price book in the ...
3
votes
2answers
3k views

Is it possible to upsert PriceBookEntry

I have tried upserting PriceBookEntry PricebookEntry p = new PricebookEntry(); List<PricebookEntry> lstp = new List<PricebookEntry> {}; Pricebook2 pb = [select Id, IsActive from ...
3
votes
1answer
11k views

pricebook entry is in a different pricebook than the one assigned to the opportunity

Could some body please help me on this? I am improving test coverage and below is my code: static testmethod void opportunityLineItem_Test(){ Id priceBookID = Test.getStandardPricebookId(); ...
3
votes
1answer
2k views

Find all Product2 records that do NOT have a PricebookEntry in the Standard Price Book

We have come to find that we have a small amount of products that have Product2 records, but no PricebookEntry for them. I'm trying to query for just those products, but I am having trouble with the ...
3
votes
3answers
5k views

Where is PricebookEntry Object

i am following this link http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_erd_products.htm .In this ER diagram there is Pricebook2Id field on Opportunity Object but i can't see any ...
3
votes
1answer
1k views

why salesforce have restriction to add products from one pricebook for an opportunity? what happen if with multiple price books?

we have a integration where we need to integrate SAP with SFDC. Now the pain comes to add products from multiple pricebook for an opportunity. what would happen if we add products from multiple ...
3
votes
1answer
1k views

Standard vs Standard Price Book

What is the difference between Standard and Standard Price Book? I am quite confused why there are two price books by default.
3
votes
1answer
2k views

Using multiple pricebooks in an opportunity

When adding products to an opportunity I can only use one pricebook. In my case I need products from multiple pricebooks. How can that be done?
3
votes
2answers
2k views

Assign Product to OrderItem

I am trying to create an orderitem from visualforce page and I am getting an error Attempt to de-reference a null object while assigning pricebookentry.priduct2Id.Here is my part of code where it ...
3
votes
1answer
2k views

Using Product standard price in Custom Object

I'm trying to create a classic Invoice by using Custom Object Invoice (Master) Invoice Line Item (Detail) Invoice_Line_Item should have a look up relationship with Product. Also it has to include ...
3
votes
1answer
427 views

Why don't I see the Pricebook2Id field as available in formula field on PricebookEntry?

I want to create a formula field on PriceBookEntry using the Pricebook2Id field, but it's not available, yet in the fields like it has it as a reference/lookup field. Product2Id is there. Any idea why ...
3
votes
1answer
188 views

Is there a simpler way to traverse relationships to update cross object fields?

I have a trigger that works but it seems like there should be a better and simpler way to accomplish the result. I have a custom object that is a child of Quote and has a lookup to Product2. I am ...
3
votes
2answers
3k views

Cannot find product to add to Opportunity

I have crated few products. Now I cannot find them when I am trying to add them to the Opportunity. Products are active. They are added to a Price Book. Price Book is also active. Any idea what is ...
3
votes
1answer
338 views

How-to: Package products as a single product - AKA - CPQ

I have received a request from Sales/Marketing: They need to package several of the products we sell as a single product/Combo - and give it a promotion price for a certain period. It's an addition ...
3
votes
1answer
209 views

In Pricebook Entry validation rule I am not able to access the Pricebook fields

I am trying to create validation rule under Pricebook entry object. In that I am not able to access the Pricebook field, we have standard lookup "Pricebook" field in Pricebook Entry.
3
votes
0answers
230 views

Error while adding an product to an opportunity

When user tries to Add an Product to the opportunity record ,it throws an Error as : Currency null is not supported by this org. The price book which user is selecting is "Standard Price Book" . At ...
3
votes
2answers
1k views

Trigger to Update Opportunity Price Book

I created the class below to fire on an Insert/Update trigger on the Opportunity. It is meant to change the Opportunity price book based upon the value entered in a custom picklist on the Opp. ...
3
votes
2answers
1k views

Defaulting the Quantity and Cost on an Opportunity product line item

We have a custom field on our Opportunity Product that is called IIS Cost and we would like for some Product records to be able to have this value defaulted from the PricebookEntry. For example I can ...
3
votes
0answers
167 views

Multiple pricebooks using quotes?

Is it possible to have multiple quotes related to the same opportunity that use different pricebooks? For example, if you have one pricebook setup for 12-month pricing (subscriptions) and another for ...
3
votes
0answers
369 views

Difference in Sharing modes of PriceBook (Product Portfolio)

When I look at any Product Portfolio sharing page I found these option: 1) To add a Public Group in which we can share the particular PP with Group's, Roles, Roles and Subordinate & User's. ...
2
votes
2answers
7k views

FIELD_INTEGRITY_EXCEPTION, field integrity exception: PricebookEntryId (pricebook entry is inactive): [PricebookEntryId]

Can't wrap my head around this error. Any ideas? @isTest public class RemoveProductFamilyTriggerTest{ static testMethod void RemoveProductFamilyTriggerTestmethod() { Date cd = date.parse('10/10/...
2
votes
3answers
2k views

Is that possible to see the list of Price Book Entries?

Is that possible to see the list of Price Book Entries? Does Salesforce have any standard functionality to display it? I tried to find a one but I ended with PriceBook and Products. Any thoughts ...
2
votes
1answer
6k views

Error:-PricebookEntryId (pricebook entry is in a different pricebook than the one assigned to the opportunity): [PricebookEntryId]

i am trying to solve this error but not able to solve, can anyone plz help me out. i have already set the standard pricebook. Error---- System.DmlException: Insert failed. First exception on row ...
2
votes
1answer
2k views

Test class pattern for pricebook when standard pricebook is deactivated

I'm trying to write a test class without the "seealldata=true" option and all I have is a custom pricebook, as my standard pricebook has been deactivated. The relevant part of the test is as follows; ...
2
votes
2answers
4k views

How to move a Pricebook and its Products from sandbox to production?

As the title suggests, I have created a pricebook with a list of products and their prices in my sandbox. I would like to know how I can export this data into my production instance.
2
votes
1answer
2k views

can i maintain 5 prices for a product with the same currency based on its volume?

The current status of out business is such that , they maintain different prices for different cities in the same country. Also, they maintain different prices for different volumes. Example : ...
2
votes
1answer
3k views

Price book entry is in a different pricebook than the one assigned to the opportunity

I am facing the issue while deploying the test class in production. The test class is working fine in sandbox but failing in production System.DmlException: Insert failed. First exception on row 0; ...
2
votes
1answer
702 views

Price Book Record Types

Is it possible to have Price Books associated to different record types and assign these record types to specific profiles in order to have a refined list of price books available to only certain ...
2
votes
2answers
402 views

Best practice for handeling bulk prices (graduated prices) in Salesforce

We have a client who wants to synchronize products between Salesforce and his ERP solution (Sage Office Line). In Sage it is possible to have many graduated prices (in German we say "Staffelpreise") ...
2
votes
1answer
2k views

Price Book Access Control?

Is anyone aware of a way to control access to Price Books? I'm finding no joy either here on SE or via Google. Our company previously had price books for each "country region" (like North America, ...
2
votes
1answer
3k views

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

I was hopping to be able to remove the @seeAllData annotation from my tests by using Summer'14's addition - Test.getStandardPricebookId() but the test are failing with this error: System....
2
votes
1answer
55 views

Soft release a product in Salesforce

I want to add some products into another environment towards release and I want to be able to hide the product from certain users for a while. Then if everything goes well I want to make it visible to ...
2
votes
1answer
708 views

How to link account to pricebook

I'm working on an application in which it should be possible to link an account to a pricebook. Because for different accounts, different prices may be appropriate. Is there a way to directly link an ...
2
votes
1answer
107 views

How to give SalesReps access to PriceBook "X" Only on specific Opportunity

I have multiple (PB) price books, A, B, C, D. I want to give full access to PB C & D to all Sales Reps for all opportunities, and only give access to PB A & D if the Manager selected either of ...
2
votes
1answer
700 views

Multiple pricebooks on one opportunity

I've seen this question a few times, but there never seems to be a resolution. How can I make it possible to link multiple pricebooks to an opportunity? We're trying to implement something in our org ...
2
votes
1answer
373 views

PricebookEntry List not populated in query, don't understand why

I have the following code block: Map<Id, Product2> productMap = new Map<Id, Product2>(); List<Product2> prodList = new List<Product2>(); Set<...
2
votes
1answer
2k views

UseStandardPrice field when import PricebookEntry

I’am going to insert the prices for my products, but i’m not sure about how setup (true or false) the field UseStandardPrice of the object PricebookEntry. I have found this : UseStandardPrice ...