Questions tagged [pricebookentry]

Represents a product entry (an association between a Pricebook2 and Product2) in a price book.

Filter by
Sorted by
Tagged with
5 votes
1 answer
7k views

Get custom Picklist value in LWC without Record Type

I have created a custom Picklist in PricebookEntry and trying to get the Picklist values in LWC. All the solutions I found needs to pass the RecordTypeId to get the list. @wire(...
Tapas Mukherjee's user avatar
5 votes
1 answer
2k views

In which sequence should I be creating/inserting order/orderItem/pricebookEntry/product2?

I'm on the advanced apex super badge step 7, and before this I thought I had a good understanding of order/orderItem/pricebookEntry/product2/pricebook2 objects. However, upon creating my own ...
rna7's user avatar
  • 347
5 votes
1 answer
5k views

Add a lookup to Price Book Entry on a Custom Object

I want to a lookup to PriceBookEntry on a custom object. SalesForce does not give me an option to create a lookup to PriceBookEntry, it only gives an option for PriceBook. Kindly tell me how should I ...
Ram Dhayalan's user avatar
5 votes
1 answer
275 views

Is there any hook/event when a product is archived?

I have a requirement to stop products with certain attributes from being archived in Salesforce. Is there anyway to hook into this event happening? Obviously I tried triggers, but a trigger ...
Simon Lawrence's user avatar
4 votes
3 answers
10k views

How to find out relationships for SOQL queries?

I want to construct a SOQL query displaying all Opportunities that are sorted by the Products that are associated to it. I however have a problem finding out how Opportunities and Opportunity ...
mcbetz's user avatar
  • 927
3 votes
2 answers
10k 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/...
Nebbyyy's user avatar
  • 828
3 votes
2 answers
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 ...
DOMINIC EDWARD's user avatar
3 votes
1 answer
3k 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 ...
AstroLovesCodey's user avatar
3 votes
1 answer
711 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 ...
Irene's user avatar
  • 1,703
3 votes
2 answers
577 views

Change the label of a standard field of PriceBookEntry object

Is it possible to change the label of a field (in my case I'd like to change the label of the UnitPrice field) of the PriceBookEntry standard object ? In the setup -> tabs and labels, I don't see ...
dou's user avatar
  • 1,899
3 votes
1 answer
775 views

Using Test.IsRunningTest(), Risks and use-cases

Through our testing coverage implementation on a project, we encountered some collisions on a trigger which assigns a Pricebook to a Product and our test data factory (uses "@test setup" tag => no ...
Answers_Seeker's user avatar
3 votes
1 answer
385 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.
Satheesh's user avatar
2 votes
2 answers
6k views

Pricebook and PricebookEntries with different currencies

Can Pricebook and its PricebookEntries have different currencies? So, if I create a Pricebook with currency USD and its PricebookEntries with multiple currency like USD, GBP, AUD, etc., is this ...
Nilang Pandey's user avatar
2 votes
3 answers
3k 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 ...
Bforce's user avatar
  • 6,774
2 votes
2 answers
9k 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 ...
Sharma_raj's user avatar
2 votes
1 answer
376 views

Unable to add PriceBookEntry with APEX

i want to add product price into PricebookEntry object with help of following APEX code: PricebookEntry pBook = new PricebookEntry(UnitPrice = price, ...
Rajinder's user avatar
  • 119
2 votes
1 answer
3k 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 : ...
Siddharth Lakhotia's user avatar
2 votes
1 answer
5k 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; ...
Sanshita Shah's user avatar
2 votes
2 answers
1k views

Not able to add Products to Price book entries

I am trying to insert products to price book entries and getting the following error "Variable does not exist: Pricebook2Id" Public class pricebookadd{ public void pricebookentry(){ ...
Priyalakshmi's user avatar
  • 1,456
2 votes
1 answer
3k views

REQUIRED_FIELD_MISSING & FIELD_INTEGRITY_EXCEPTION on PricebookEntry Insert

I want to use standard price for the Pricebook entry. PricebookEntry pbe = new PricebookEntry(Pricebook2Id='01sN00000002OTsIAM', IsActive=true, Product2Id='01tN0000004JGeuIAG', ...
sfdcFanBoy's user avatar
  • 4,035
2 votes
0 answers
74 views

Timeout Error when cloning a pricebook

I am getting a timeout error when cloning my Standard pricebook. Any known limits (as to the number of product or pricebook entry records)?
NikitaChe's user avatar
2 votes
0 answers
1k views

Get a pricebookEntryId for a custom object(having product2id field)

I have a custom object SapLine which is like opportunityLine, i.e has a product2 lookup field. The hierarchy is Opportunity-->OpportunityLineItem, SapOrder-->SapLine. I created a PricebookId field on ...
Alan Abishev's user avatar
2 votes
0 answers
447 views

How to setup Products and Price books ? - Complex Scenario (Professional Edition) [closed]

All SF lovers, We wanted to use SFDC products/pricebooks to setup products & services and planning to go with Professional Edition. For Services, we have a standard delivery fee for the services ...
Rob's user avatar
  • 335
2 votes
0 answers
959 views

Trigger on PricebookEntry

I want a field on Custom PriceBookEntry to be updated from Standard PriceBookEntry when it is created. However, Salesforce doesn't allow writing a trigger on PricebookEntry. What are the options I am ...
RajeshShah's user avatar
  • 1,754
1 vote
1 answer
989 views

Can I show the standard price on the product layout page?

I know I can click the Related Tab and drill into the Standard Price Book to see it, but it would sure be nice to just show it on the product page. Is this possible?
Scott C Wilson's user avatar
1 vote
2 answers
2k views

FIELD_INTEGRITY_EXCEPTION, This price definition already exists in this price book

My requirement is to take any pricebook entry made in the standard pricebook and replicate/update it in a second price book. With the code below I keep getting the error FIELD_INTEGRITY_EXCEPTION, ...
Merry Stambaugh's user avatar
1 vote
1 answer
339 views

Visualforce Lookup field not allowing entry for certain profiles

I have a visualforce form with 3 entry fields, 2 of which work for all profiles but one doesn't. It works for admin profile though. I've checked the VF security setting and field level security on ...
Irene's user avatar
  • 1,703
1 vote
1 answer
4k views

Can I add multiple currency prices to a product in one data upload?

I am using the data uploader to add prices to a bunch of products I just created. We work in GBP, EUR & USD; Can I use one spreadsheet to upload all currencies in one hit (standard Price) or ...
Paul Rogers's user avatar
1 vote
2 answers
215 views

How can you import a standard price book catalog in a scratch org with the data import command?

When a scratch org is created its default price book is already created in the org. The JSON files with the dummy data in the repository, however, do not contain the ID of the price book record, or it ...
Renato Oliveira's user avatar
1 vote
1 answer
328 views

BulkAPI 2.0 Import PricebookEntries via Postman getting this error:STANDARD_PRICE_NOT_DEFINED:Before creating a custom price, create a standard price

I have setup the Postman requests to talk to the salesforce BulkAPI 2.0 because the dataLoader doesn't work (MacBook M1). The import of the pricebookentries fail at a point because when I import the ...
AMMA's user avatar
  • 301
1 vote
1 answer
2k views

Process builder Create Product and Pricebook Entry at the same time

We are trying to automate our product creation process, I have created a new object called internal request which has all the product fields we require and once an approval process is approved it sets ...
ClevelandDan's user avatar
1 vote
2 answers
8k views

Pricebook entry currency code does not match opportunity currency code

I have a Visualforce page which create a product record, a priceBookEntry record and a opportunityLineItem record. I don't understand why in only one case, I get this error : In my code, I first ...
Oupat's user avatar
  • 713
1 vote
1 answer
276 views

Error when I try to create OrderItem records Insert failed. INVALID_CROSS_REFERENCE_KEY

I'm trying to create a visualforce page where a user can create multiple OrderItem records at the same time. The error that I get is OrderItem records Insert failed. First exception on row 0; ...
Chandlerbeen's user avatar
1 vote
1 answer
1k views

Is it possible to update Order Product on Draft Order?

We are trying to utilize the Order object, but we're finding that if we create an Order Product, we are unable to change the product (i.e. essentially the Pricebook entry), even if we're in a Draft ...
Maya Tran's user avatar
  • 229
1 vote
2 answers
3k views

FIELD_INTEGRITY_EXCEPTION when creating Price Book Entry from flow

I have created a flow that creates a pricebook entry for new products (based on a custom field on the Product object), however when I debug the flow it comes up with the following quite generic error: ...
Kees's user avatar
  • 31
1 vote
1 answer
157 views

Failure when inserting records via dataloader, however anonymous apex inserts fine

I'm getting the following error when running dataloader (inserting new quotelineitems), however an identifcal anonymous apex works fine - any thoughts? Error: The price book entry is in a different ...
rmarq423's user avatar
  • 948
1 vote
1 answer
4k views

Automatically add a Standard Price Book Entry after creating product

I am successfully importing a CSV of products and creating Product objects in Salesforce. I'd like to be able to automatically (or even via CSV update) create Standard prices for those objects, but ...
Scott C Wilson's user avatar
1 vote
1 answer
877 views

Make Price Book Entry object's Product Code field Read/Write

I'd like to automatically create Standard Price Book entries for new products using dataloader.io. I am successfully creating the new products, using the Product Code as the ID. But when I go to ...
Scott C Wilson's user avatar
1 vote
2 answers
4k views

FIELD_INTEGRITY_EXCEPTION, The price book entry is Inactive

I'm a bit stumped. Everything was working fine for a few months and then errors like this started popping up, any idea how to fix it? Here's the trigger : trigger RenewalOppTrigger on Opportunity (...
StormKrow's user avatar
  • 173
1 vote
1 answer
6k views

Apex class getting the product fields from pricebookentry where pricebook name ='Test' [duplicate]

We are having Product , Pricebookentry and pricebook in SFDC as a standard object. here pricebookentery is having look up to product and pricebook. so i want to get all the prodcuct fields which is ...
Debadatta Padhy's user avatar
1 vote
1 answer
2k views

Trigger on Pricebook Entry or Finding whether a Product has a standard price [duplicate]

I need to perform some action when a Standard price is added to a product. I need to capture when it happen, so SOQL won't help me here. How can I trigger on new PricebookEntry or, is there a field on ...
Dedo's user avatar
  • 4,981
1 vote
0 answers
552 views

I can't create quote line items with community user

From a community, I need users to be able to create quotes and their quote line items. With the community user, I create the opportunity, then I create the quote. Then when trying to create a ...
Chandlerbeen's user avatar
1 vote
0 answers
501 views

DataLoader batch job failing with PricebookEntry upsert

I have an issue with our PRICE BOOK ENTRY Upsert using the DataLoader batch bulk job. We have External IDs in our PRICE BOOK and PRODUCT objects that we use when Upserting to our PRICE BOOK ENTRY ...
VinceD's user avatar
  • 11
1 vote
0 answers
939 views

Selecting the Opportunity Price Book

I'm still fairly new to Salesforce Apex and trying to figure out how to select a price book from the opportunity. The reason being I have a trigger which adds in a product when the opportunity is ...
Will May's user avatar
1 vote
1 answer
1k views

auto-add product to opportunity based on product that has been added manually

Code: trigger Attempt1 on OpportunityLineItem (after insert) { List<OpportunityLineItem> oliList = new List<OpportunityLineItem>(); List<String> lstProductNames = new ...
user avatar
1 vote
1 answer
50 views

Automatically add ProductB once ProductA is manually added to the opportunity [duplicate]

I have been trying to get this trigger to work and it has been impossible... ugh... maybe you guys can help me. I have created the following trigge with the help of some freinds under "Opporunity ...
user avatar
1 vote
1 answer
650 views

Scheduled Process to Update Price Book Entries

I need to write a process to handle the following: Retrieve all price book entries for the standard price book Retrieve all price book entries for non-standard price books that have a matching ...
AndrewG's user avatar
  • 11
1 vote
1 answer
2k views

Not in package.xml error when deploying to Pricebook2 and PriceBookEntry with Ant Migration Tool

I have been successfully migrating fields between orgs using Ant by retrieving from source org and deploying to target org. However, when I got to fields in Pricebook2 and PriceBookEntry, the ...
MikeA's user avatar
  • 1,035
1 vote
0 answers
643 views

The StandardPrice field appears in the PriceBookEntry object, but I can't include it in a query

This query works: select name, UnitPrice, ProductCode, UseStandardPrice from PriceBookEntry But this query fails with the complaint "No such column StandardPrice": select name, UnitPrice, ...
user2171796's user avatar
1 vote
0 answers
108 views

Logic for adding OLI

I have the following code for adding a OLI to an Opp. It is passed an Opp ID and will grab a few Pricebook Entires based on the already set Pricebook and the Product i have set. It will then only add ...
JamesM's user avatar
  • 11