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
SainSain 

if i select any picklist value in custome field it has to popup related value on another customer field.

Hi,

My requirement is if i select any picklist value in custome field it has to popup related value on another customer field.

Let me explaine in detail, i have two fields like medical procedure(picklist) and price field.  If i select any picklist value in medical procedure it has to be popup price field with related value.

Please SHARE, Does anyone has some sample code or can point me in the right direction?
Many thanks!!!
Vatsal KothariVatsal Kothari
Hi,

You can use Workflow rule for this.
go to setup --> Workflow & Approvals --> Workflow Rules.
Create New Rule by selecting your object.
You can use ISPICKVAL( ) function inside formula field.

If this solves your problem, kindly mark it as the best answer.

Thnaks,
Vatsal
Vatsal KothariVatsal Kothari
If you have multiple medical procedure(picklist) values and dont want to create workflow rule for each picklist value, than you can also create formula field with return type of Currency/Number. But Formula field is read only field so you can not edit it.

Other solution is to write apex trigger for updating Price field value.
Example:

trigger updatePrice on YourObject__c (before insert,before update){
   for(yourObject__c obj : trigger.new){
      if(obj.medical_procedure__c == 'ABC')
      {
         obj.price__c = 25;
      }//you cann add multiple condition
}

If this solves your problem, kindly mark it as the best answer.

Thnaks,
Vatsal
SainSain
Hi,

Thanks for your quick response.

Here my reuirement is while i select value in picklist it should popup related price value(price field) before save record. and also i have more than 50 values in picklist, each value have diffrenent price.

Thanks
Shaik
Vatsal KothariVatsal Kothari
Above mentioned approach will update the price value after saving the records.
If you want to update it before saving the record than you have to create visualforce page for that, which will update the price value using javascript / jquery.

Thanks,
Vatsal
Shyam BhundiaShyam Bhundia
Checkout my reply on your other post (https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AgxCIAS).  It uses formula field, but only updates the price when the record is saved.
Tony TannousTony Tannous
Dear,

You can create the price field as picklist that contains all the price you have and then create field Dependencies on medical procedure field

this should be a solution for you.

Good Luck