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
Sujit KarandeSujit Karande 

Check the value of Lookup field in visualforce page

Hello,

I have opportunity inside which I have added some products, lets say p1, p2.

Those two products are having different price books. So if user select pricesbook1, product p1 is available to select.

And if user select pricebook2, product p2 is available to select.

So when user createn an ooportunity, I have added one Button which redirects user to custom visualforce page(say Form) where user needs to put the data and submit. 

And I would like to show the fields on that form depend on product's pricebook.

Lets say. if the product belongs to pricebook1, I will show only few fields on that form.

And if the product belongs to pricebook2, I will show it will show some other fields on that form.

I have done some R&D and found that "ISRENDERED" function might help. But Product object is lookup field inside opportunity. 

How could I check if the poduct's pricebook inside visualforce page?
RKSalesforceRKSalesforce
Hi Sujit,

You can use inner query to get associated Products and Pricebook details. Create custiom setting records and put your fields in the custom setting and those fields could be used in the code whenever required. Custom setting shoukd be created depending on your Procebook. And to get the details of custom setting records you can use custom setting methods.
Hope this will help.

Regards,
Ramakant
 
Sujit KarandeSujit Karande
Thank you ramakant.

Could you please help me about custom setting? As I am new to the salesforce. 

I will be appreaciated