Questions tagged [pricebookentry]

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

Filter by
Sorted by
Tagged with
2
votes
2answers
27 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(...
0
votes
1answer
37 views

How to display Product fields and it's pricebookentries in a single datatable?

I need to dynamically put products and the products' pricebookentries in a single row in a datatable. If I add a pricebook, a new column and it's prices should also be displayed. I could do this for ...
-1
votes
1answer
31 views

string.isempty doesn't appear to work when trying to retrieve price list Name

it appears my if statement with String.isEmpty doesn't seem to be working. What i want it to do is check if a price list entry doesn't exist it creates a new one, and if it does it updates that one. ...
0
votes
1answer
35 views

Not Able To Update Price Entries

I am trying to insert products, then those products then create price entries if they don't already exist but if they do exist they update the previous price entry based on the name of the product ...
0
votes
0answers
30 views

Use Database.upsert with external id field is not working on PricebookEntry object

I need help to do a DML operation with external id field. I am using the below syntax, but it is throwing an error Schema.SObjectField f = PricebookEntry.Fields.Product_Code__c; Database.UpsertResult[...
3
votes
1answer
45 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 ...
0
votes
1answer
75 views

Load PricebookEntry in empty Scratchorg with Cumulusci

When generating a .yml file with generate_dataset_mapping with cumulusci it resolves in following code(sample): Insert Product2: sf_object: Product2 table: Product2 fields: Id: sf_id ...
0
votes
1answer
23 views

How to restore or undelete PricebookEntry records

Is it possible to undelete/restore a deleted PricebookEntry record? I am not referring to restoring a Price Book or Product record but hitting the delete button on an entry record itself, then ...
0
votes
1answer
25 views

Order Pricebook2Id to manage with multiple Order Product Pricebooks

Scenario: There are multiple Order Products with different Pricebook(Year wise Pricebook) to be added on Order Object. But, on Order Object we can only set a single Pricebook Id. Can anyone please ...
1
vote
1answer
74 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; ...
-1
votes
1answer
186 views

Add a picklist value to Global Value Set in test class

I am working on test class that inserts an Opportunity with the opportunity products using the correct price book/price book entry. The OpportunityLineItem has a ProductSelected__c picklist field. We ...
0
votes
1answer
159 views

Different currencies in PricebookEntry throwing exception FIELD_INTEGRITY_EXCEPTION, PricebookEntryId (must have the same currency as the order)

I wrote a trigger which converts a Quote to Order on changing Status to a particular value. This Quote has QuoteLineItems, hence, they should converted to corresponding OrderItems. Now when the ...
0
votes
2answers
49 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 ...
2
votes
1answer
230 views

PriceBookEntry required field missing when creating QuoteLineItems

I am kind of new to CPQ and have been trying to create a Quote Line Item with no success. Opportunity OpportunityOne = [SELECT Id, PriceBook2Id FROM Opportunity WHERE Id='...
0
votes
0answers
95 views

Pricebook2Id not populating in opportunity when default price book is already present

I have applied a default pricebook to a set of users. When I try to add products to that opportunity the pricebook already shows that it is selected at the product selection screen but still ...
0
votes
1answer
81 views

I am unable to query pricebook entry. (Internal Salesforce Error)

I am making a lightning component for a user to create a quote + line items quick and easy. However the apex function that is meant to query the pricebook entry and its Id for each line item is ...
1
vote
0answers
101 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 ...
1
vote
1answer
210 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 ...
0
votes
1answer
51 views

PricebookEntry Conflict Error not matching existing products

I am getting an error message on a trigger that was working until recently. The issue arises on a trigger that inserts an OpportunityLineItem on an Opportunity. Here is the error: Insert failed. ...
1
vote
1answer
646 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: ...
1
vote
1answer
92 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 ...
0
votes
1answer
142 views

Trying to do an SOQL Query for all product names and their Price books

I Have a Salesforce Org where there are almost 1000 products and 51 Price books, I want to know a query where I can get each product and the price books they belong to. Any help is much appreciated!
0
votes
1answer
64 views

How to prefill UnitPrice on Order Products

I want my Order Product price to prefill based on the price defined on the Pricebook Entry. I swear I've seen this work in the past, but I can't figure out why this time I keep getting an empty field ...
4
votes
1answer
811 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 ...
3
votes
1answer
938 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 ...
0
votes
1answer
363 views

Deep Cloning a Product - Clone Standard Price and Custom Prices

I have created a Record Detail button to clone a Product's detail, a related list called Bill of Materials, and both the Standard PB Entry, and any Custom PB Entries. If I remove the Custom PB Entry ...
1
vote
1answer
1k 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 ...
1
vote
1answer
465 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 ...
1
vote
1answer
578 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?
1
vote
2answers
910 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, ...
-1
votes
2answers
250 views

SOQL Query on PricebookEntry returning no rows

I'm trying to create a queueable apex class which will update the unit prices of all Products (on all Pricebooks) based on newly updated exchange rates. I'm able to successfully query on ...
2
votes
1answer
141 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.
0
votes
2answers
959 views

Test Classes failing due to default custom pricebook

Our admins developed and activated a process builder in Production to set a default custom pricebook on opportunity during the opportunity creation process. Due to this, several of our test classes ...
1
vote
0answers
39 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)?
0
votes
2answers
1k 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 (...
2
votes
1answer
1k 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 : ...
0
votes
1answer
528 views

Unable to set pricebook Id in orderitems

I am writing trigger "On Insert Of Order(Sales order) copy opportunityLineitems to order line items" I have done everything fine upto my knowledge but when I am inserting order it is showing pricebook ...
-2
votes
1answer
396 views

Getting Pricebook entry Error

Hello I want to automatically add a secondary product when a user adds a product to an Opportunity. I have a trigger that feeds the lineitem to a class. My class then looks for the product but ...
1
vote
1answer
2k 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 ...
1
vote
1answer
1k 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 ...
1
vote
1answer
4k 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 ...
1
vote
1answer
651 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 ...
1
vote
1answer
45 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 ...
0
votes
1answer
111 views

Attempt1: execution of AfterInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.Attempt1: line 4, column 1

I'm getting the following error when I try to add a product to an opportunity. I am working on a trigger that would automatically add a productB whenever productA is added to the opportunity. Are you ...
2
votes
1answer
2k 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', ...
1
vote
1answer
209 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 ...
0
votes
1answer
56 views

Adding Product via VF and getting Pricebookid from Opportunity

In my viualforce page I am adding products - I don't want to hardcode the references to the products, I want the button to pull the proper product per Opportunity. Why does my line not work to find ...
2
votes
2answers
5k 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/...
1
vote
1answer
236 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 ...
2
votes
0answers
462 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 ...