Questions tagged [pricebookentry]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

STANDARD_PRICE_NOT_DEFINED, No standard price defined for this product

I checked the other answers about this topic but I have no clear result. I think Id pricebookId = Test.getStandardPricebookId(); is use to get a standardPrice before insertion of PricebookEntry in a ...
0
votes
2answers
45 views

Update both Pricebook2 and PricebookEntry objects using just one for loop

Having the next code: for (WrapperTest pb : pbs_lst) { Pricebook2 newPB2 = new Pricebook2(); PricebookEntry newPBE = ...
0
votes
0answers
14 views

Want filtered Products while trying to add Order products in Order's Related List

I am using Order and Order Products to generate Invoices for customers. Issue is the Products(PriceBook Entries) available are different on the basis of different Location, and while adding these ...
0
votes
0answers
21 views

Trigger after Insert Order Item - PriceBook Entry

I have a trigger After insert on OrderItem. This Trigger should insert automatically dependents product in the order . My Problem is that I don't understand how I can efficiently set the ...
0
votes
1answer
36 views

Are Pricebook and Pricebookentries available in Service cloud? [closed]

Please let me know if these objects are available in service cloud.
0
votes
0answers
14 views

Add Product on Order - PriceBookEntry not active

For some sale processes, I need to add specific items on Order through code that I don't allow users to Add from the add Product screen. To do that I simply disactivated the PriceBookEntry of this ...
0
votes
1answer
147 views

Insert PriceBookEntry using Product2 External Id field

I am developing an external application which will insert & update products and their pricebook entries into Salesforce system. In order to avoid maintaining the Salesforce ProductId in my ...
0
votes
0answers
49 views

first error: INVALID_CROSS_REFERENCE_KEY, Entity not available: [PricebookEntryId]

When I am trying to run my test class I am getting the below error. System.DmlException: Update failed. First exception on row 0 with id 8023B000000ekyaQAA; first error: INVALID_CROSS_REFERENCE_KEY, ...
2
votes
2answers
568 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
114 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
32 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
42 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
58 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
114 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
79 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
53 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
65 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
99 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
374 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
472 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
380 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
544 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
198 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
101 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
263 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
534 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
78 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
900 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
105 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
228 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
194 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 ...
5
votes
1answer
1k 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
1k 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
428 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
2k 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
523 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
651 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
1k 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
351 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
159 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
1k 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
63 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
2k 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
677 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
438 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
750 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 ...