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
sfdc development hintssfdc development hints 

hi , can anyone help me writing a formula field for below condition

 2.1.2.Updating the value of the new field Chnnel in Account object       
    The value of the Channel field will be populated based on the Account Profile's field Chemist type. 
     If the Chemist type is blank then the Channel will be "Doctor" else it will be "Pharmacy"   
                                 



TrimbleAgTrimbleAg

Well.... You could use a validation rule or a formula... but if you have workflows it would be easier....

 

PB

Cloud on FireCloud on Fire

why would workflow be easier in this case? Unless I am totally misunderstanding this, the Chnnel field is 1 of 2 values based on if the Chemist field is blank or not

 

Use a formula field as follows

IF(OR(ISNULL(Chemist__c),ISBLANK(Chemist__c)), "Doctor", "Pharmicist")

 

Isn't that simple? Or am I not understanding the requirement?

TrimbleAgTrimbleAg

And whats not simple about creating a workflow? Congrats, you gave the formula, but that doesnt mean it was any easier to create a workflow.

 

PB

Cloud on FireCloud on Fire

of course the formula field is easier and more straight forward and will always be immediately updated.

 

Using workflow you have to

1. create the rule

2. create the field update using the same formula anyway

3. activate it

4. wait for it to fire

 

So you could have 1 step or 3.

sfdc development hintssfdc development hints

thats a picklist field , can i change the data type of the picklist field to formula to write this formula , or should i write a workflow or a trigger for this....?