function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Cloud_BKCloud_BK 

SOQL query on PricebookEntry

Not sure why this is not returning anything for my querry, any help would be appreciated

 

I am trying to return a specific unit price based on a particular Product2ID and PricebookID which are represented in my custom object (cld_Registrants__c) as ProductID__c and PricebookID__c fields respectively.

 

[Select UnitPrice From PricebookEntry Where Product2Id = cld_Registrants__r.ProductID__c and Pricebook2Id = cld_Registrants__r.PricebookId__c]

 

Also, there may be a better way to populate a unit price on a custom object.

 

Thanks,

 

Brian