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
MrithulaMrithula 

add values on textfield

hi,

 

iam new to salesforce and i need help to add some values , which should be retrived from 3 textfields and it should be displayed in another text field.

 

for E.g.,

 

i have 3 text field

 

1. X-ray fees

2. E.C.G fees

3.Indoor Injection fees

 

I) i have to retive the values from these textboxes 

II) add these values 

III) display the added values in another txt box (Say) Total Fees

 

and i don't have idea how to implement this one using formulas..

Jeff MayJeff May

In a custom formula field, you can add 3 strings together, or you can add numbers and display them as strings.  Use the Advance Formula Editor to see all the available fields, and formula functions available.

 

To combine 3 number fields into 1 total, (replace your field names in the example below)

 

XRay__c + ECG__c + IIndoor

PrabhaPrabha
JeffM is right if you want to show them in a formula field which is read-only to the user,
And I see you are looking to put it in a text field, so I'll add to jeffM's comments with the following.

1. Have that formula field ready and
2. Create a workflow rule to update "Total Fees" when ever they are changed.
3. activate the workflow.

HTH
Prabhan
Janet GuoJanet Guo

I agree with both JeffM and prabha. Just have a few more comments to add.

 

If you want your "Total Fees" field to be editable and therefore chose prabha's suggestion, you don't actually need a formula field to add the values together before copying it the result with a workflow into the "Total Fees" text field (that's what I understood from prabha's comment, apologies if I misunderstood). You can use your workflow rule's field update to directly calculate a value from the 3 fields and put it into the "Total Fees" field. 

 

Also, you can use the "ISCHANGED()" function in your workflow rule. It's a very handy function.

 

So, something like this in your workflow rule:

OR(ISCHANGED(X_ray_fees),
ISCHANGED(E_C_G_fees),
ISCHANGED(I_I_Fees))

 

Then just add a field update to it that adds the 3 field values together.