Questions tagged [pricebookentry]
Represents a product entry (an association between a Pricebook2 and Product2) in a price book.
95
questions
0
votes
2
answers
737
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 ...
3
votes
1
answer
335
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
2
answers
3k
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 ...
2
votes
0
answers
72
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)?
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 (...
2
votes
1
answer
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 : ...
0
votes
1
answer
1k
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
1
answer
627
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 ...
4
votes
1
answer
4k
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
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 ...
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 ...
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 ...
1
vote
1
answer
48
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
1
answer
325
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
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',
...
1
vote
1
answer
576
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
1
answer
75
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 ...
3
votes
2
answers
9k
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
1
answer
328
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
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 ...
0
votes
1
answer
151
views
Not able to get the UnitPrice using MAP
I have a Custom object Product_Quantity__c and it has a lookup field for Product, when user going to select any of the Product from that lookup field in Visualforce page then what i need is that ...
0
votes
0
answers
1k
views
Inserting PricebookEntry from apex throwing error
I have Written a trigger to insert a pricebookentry based on creation of product. I am using custom pricebooks in my org. But I couldn't able to insert pricebookentry and apex is throwing following ...
3
votes
1
answer
626
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 ...
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; ...
0
votes
2
answers
381
views
Deleting a Pricebook Entry using Process Builder that invokes an Apex Class
apologies if i'm wording this incorrectly, i'm not a developer! I want to delete a pricebook entry if a checkbox is checked on the product object, I'm using process builder to determine the records ...
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 ...
1
vote
1
answer
3k
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 ...
0
votes
0
answers
776
views
OpportunityLineItem:- Field Integrity Error
I am trying to automate the following functionality: When an opportunity stage becomes 'Pending Payment', insert 2 'OpportunityLineItems' using 2 predefined Products.
This is my current code. I am ...
1
vote
0
answers
632
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, ...
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 ...
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 ...
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(){
...
2
votes
1
answer
368
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,
...
-1
votes
1
answer
140
views
Apex error - Pricebook error [closed]
//Please help me with error 'field integrity exception: PricebookEntryId (pricebook entry is in a different pricebook than the one assigned to the opportunity)'
// Below is the code. It is giving ...
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 ...
1
vote
1
answer
813
views
STANDARD_PRICE_NOT_DEFINED for more than 1 currency
I tried to populate PriceBookEntry for different currency in test class.It works for only one for one currency, when i try to add different currency it fail.
System.DmlException: Insert failed. ...
3
votes
1
answer
734
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 ...
0
votes
1
answer
109
views
calling PriceBookEntry from Javascript
After reading tons of links, posts and many documents, I decided to ask for help here, hopping some guru can help me with this issue:
<!-- Visualforce Remote object component for Products -->
&...
2
votes
1
answer
8k
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
0
answers
444
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 ...
5
votes
1
answer
247
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 ...
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 ...
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 ...
2
votes
0
answers
945
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 ...
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 ...