Creating custom fields based on selection of fields i need to get result and total result in another custom fields in sugarcrm 7

Hello Frieds

I want to create a Three Radio box with lable on top, then i want one text box (Salary).

When their check from Four Radio box based on that i need to display the value on text box (Salary).

Example: How much experience you have?

1 Year - if we select then Salary should be 10

2 Year - if we select then Salary should be 20

5 Year - if we select then Salary should be 50

10 Year - if we select then Salary should be 100

Like this i want all 3 Radio Lable boxes.

Finally all this 3 Radio Lable boxes Salary value should be display on another Text Box i.e Total Salary.

How i can achieve this in best way.

Can anyone please guide me on this

Thanks in Advance Ramana Raju Santhana

Regards

Sam Roy

Parents
  • Hi Sam Roy

    From your question i can understand, you need :

    1. Three Radio boxes custom filed with 4 Options in it.

    2. Three Salary custom field for each Radio box and One Total Salary custom Fields of type Text boxes

    then we need to do calculation on this fields when we check on Radio boxes.

    For this we can do this from Administrator > Studio itself

    No need of doing extra code or any custom code for you.

    As for your requirement:

      1. Creation of Radio box with Lable from studio go to your respective module:

      Studio > Module > Fields and click on Add Fields button

      Now under Data Type select Radio and fill all required fields, under Drop Down List click on Add button

      Fill all fields like Name, Item Name and Display Label click save button.

      2. Creat One Text box fields and name it as Salary

      3. Place all this fields under Layouts.

    Note: Follow step 1 and 2 for creation of all 3 Types of Radio Lable boxes

    Now you need to create a new custom field by name Total Salary with Data Type is Text Box.Do Quick R&R and check now

    You are able to see all created fields on the layout i.e You have total

    3 Radio Box with 4 options per each

    3 Salary Field Text Boxes for each Radio box and 1 Total Salary Field Text Box

    We will do the calculation part on 3 Salary Fields and 1 Total Salary Field to do so:

    1. Studio > Module > Fields, select your first Salary field and click on it will open in edit window

    2. Now check Calculated Value check box and click on Edit Formula button.

    3. Add following formula as: ifElse(equal($Radiobox_lable_name,"1 Year"),"10",ifElse(equal($Radiobox_lable_name,"2 Years"),"20",ifElse(equal($Radiobox_lable_name,"5 Years"),"50","100")))

    4. Select Total Salary Text box and it will open in edit window

    5. Check Calculated Value check box and click on Edit Formula button.

    6. Add following formula as: add(ifElse(equal($Radiobox_lable_name,"1 Year"),10,0),ifElse(equal($Radiobox_lable_name,"2 Years"),20,0),ifElse(equal($Radiobox_lable_name,"5 Years"),50,0),ifElse(equal($Radiobox_lable_name,"10 Years"),100,0))

    like this you can add for remaining Two Radio Lable boxes

    7. Do quick R&R

    Hope this Helps!

    Best Regards

    S Ramana Raju

Reply
  • Hi Sam Roy

    From your question i can understand, you need :

    1. Three Radio boxes custom filed with 4 Options in it.

    2. Three Salary custom field for each Radio box and One Total Salary custom Fields of type Text boxes

    then we need to do calculation on this fields when we check on Radio boxes.

    For this we can do this from Administrator > Studio itself

    No need of doing extra code or any custom code for you.

    As for your requirement:

      1. Creation of Radio box with Lable from studio go to your respective module:

      Studio > Module > Fields and click on Add Fields button

      Now under Data Type select Radio and fill all required fields, under Drop Down List click on Add button

      Fill all fields like Name, Item Name and Display Label click save button.

      2. Creat One Text box fields and name it as Salary

      3. Place all this fields under Layouts.

    Note: Follow step 1 and 2 for creation of all 3 Types of Radio Lable boxes

    Now you need to create a new custom field by name Total Salary with Data Type is Text Box.Do Quick R&R and check now

    You are able to see all created fields on the layout i.e You have total

    3 Radio Box with 4 options per each

    3 Salary Field Text Boxes for each Radio box and 1 Total Salary Field Text Box

    We will do the calculation part on 3 Salary Fields and 1 Total Salary Field to do so:

    1. Studio > Module > Fields, select your first Salary field and click on it will open in edit window

    2. Now check Calculated Value check box and click on Edit Formula button.

    3. Add following formula as: ifElse(equal($Radiobox_lable_name,"1 Year"),"10",ifElse(equal($Radiobox_lable_name,"2 Years"),"20",ifElse(equal($Radiobox_lable_name,"5 Years"),"50","100")))

    4. Select Total Salary Text box and it will open in edit window

    5. Check Calculated Value check box and click on Edit Formula button.

    6. Add following formula as: add(ifElse(equal($Radiobox_lable_name,"1 Year"),10,0),ifElse(equal($Radiobox_lable_name,"2 Years"),20,0),ifElse(equal($Radiobox_lable_name,"5 Years"),50,0),ifElse(equal($Radiobox_lable_name,"10 Years"),100,0))

    like this you can add for remaining Two Radio Lable boxes

    7. Do quick R&R

    Hope this Helps!

    Best Regards

    S Ramana Raju

Children