• spurusho1.3904247420542078E12
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

We have a quoting application that lives on the opportunity.  Users enter the app by clicking a new quote button on the quotes related list section.  I wanted to validate that a particular pricebook was being used prior to allowing the user to enter the quoting system.

 

I've done javascript validation buttons in the past, and it works well -- something like this for example:

 

if (({!Opportunity.Ship_To_Count__c == 0}) || ({!Opportunity.No_of_Bill_To_Sites__c == 0 })) { alert('Your Opportunity is missing a Bill-To or Ship-To Site. At least 1 Bill-To and 1 Ship-To site are required to create a Quote. Please select the appropriate Bill-To and Ship-To sites using the "Select Bill-To and Ship-To button on the Opportunity page.');} else { location.replace('/apex/BM_NewQuote?oppId={!Opportunity.Id}&actId={!Opportunity.AccountId}');}

 But if I try to stick Opportunity.Pricebook2Id in there, it errors and says the field doesn't exist.  I know it does, I can see it in the schema.  Why is this field "hidden" from some parts of the app?  Any other ideas?  I'm stuck!