locked
CRM 3.0 - has anyone tried this? RRS feed

  • Question

  •  

    I'm wondering if there is a way to apply an algorithm/basic math to a form attribute in crm?

     

    example: let's say we have our leads form open. I have an attribute called "estimated value" (users can manually enter any figure into this attribute on the form ex. ( $3,000,000)....I wanted to create another attribute that would automatically calculate 15% of 3,000,000 (or whatever number they enter)

     

    so basically when they type 3,000,000....I'll have another entity called ex 15% and it would populate to $450,000 (no user imput).

     

    would I need a callout or something with an algorithm in it maybe that is applied to the original "estimated value" attribute?

     

    Has anybody had a similar request before?

     

    Thanks in advance guys/gals if you have any input or suggestions.

     

     

     

     

     

    Crm3.0Newbie

    Wednesday, December 10, 2008 3:23 PM

Answers

  •  

    If I've understood your post correctly then what you describe is possible.  You'll need to create a new custom attribute for leads and then add this new attribute to the lead form.

     

    You would then use Javascript in the OnChange event of the source field in the Lead form to calculate 15% of the source field and populate the new attribute with the value. 

     

    You should also consider making the new attribute read-only in the form so that users can't type into it.

     

    For anyone experienced with writing Javascript for CRM forms this should be straightforward.

     

     

    Wednesday, December 10, 2008 5:33 PM
    Moderator
  • This is fairly simple.

     

    Create your new attribute and add it to the form.

     

    Put this onChange on the estimated value:

     

    Code Snippet

    var margin = 15;

     

    crmForm.all.new_yournewattribute.DataValue = margin * crmForm.all.estimatedvalue.DataValue / 100;

     

     

     

    Thursday, December 11, 2008 1:56 AM
  •  

    It needs to be on the estimated value attribute. 

     

    The JavaScript will be run when a user types into/changes the value of the estimated value field and then tabs away or clicks into another field.

     

     

     

    Thursday, December 11, 2008 4:13 PM
    Moderator

All replies

  •  

    If I've understood your post correctly then what you describe is possible.  You'll need to create a new custom attribute for leads and then add this new attribute to the lead form.

     

    You would then use Javascript in the OnChange event of the source field in the Lead form to calculate 15% of the source field and populate the new attribute with the value. 

     

    You should also consider making the new attribute read-only in the form so that users can't type into it.

     

    For anyone experienced with writing Javascript for CRM forms this should be straightforward.

     

     

    Wednesday, December 10, 2008 5:33 PM
    Moderator
  •  Feridun Kadir (MCT) wrote:

     

    If I've understood your post correctly then what you describe is possible.  You'll need to create a new custom attribute for leads and then add this new attribute to the lead form.

     

    You would then use Javascript in the OnChange event of the source field in the Lead form to calculate 15% of the source field and populate the new attribute with the value. 

     

    You should also consider making the new attribute read-only in the form so that users can't type into it.

     

    For anyone experienced with writing Javascript for CRM forms this should be straightforward.

     

     

     

    perfect...now just have to figure out javascript portion. lol

     

    Thanks FK

    Wednesday, December 10, 2008 6:33 PM
  • This is fairly simple.

     

    Create your new attribute and add it to the form.

     

    Put this onChange on the estimated value:

     

    Code Snippet

    var margin = 15;

     

    crmForm.all.new_yournewattribute.DataValue = margin * crmForm.all.estimatedvalue.DataValue / 100;

     

     

     

    Thursday, December 11, 2008 1:56 AM
  •  

    Thanks Ibbz for the code snip..one question and please excuse my lack of knowledge in crm/java. still a newb here...

     

    which "onChange" attribute would I add the code....to the "estimatedvalue" attrib. or the one I will create to show the result (I'll call it "percentage" attrib)?

     

    ....wait I just re-read your response...i'll try it on estimated value and post result.

     

    Thursday, December 11, 2008 4:00 PM
  •  

    It needs to be on the estimated value attribute. 

     

    The JavaScript will be run when a user types into/changes the value of the estimated value field and then tabs away or clicks into another field.

     

     

     

    Thursday, December 11, 2008 4:13 PM
    Moderator
  •  Feridun Kadir (MCT) wrote:

     

    It needs to be on the estimated value attribute. 

     

    The JavaScript will be run when a user types into/changes the value of the estimated value field and then tabs away or clicks into another field.

     

     

     

     

    thanks FK....just got out of a meeting..about to test this out now and let you guys know the results. Thanks.

    Thursday, December 11, 2008 5:02 PM
  •  ibbz101 wrote:

    This is fairly simple.

     

    Create your new attribute and add it to the form.

     

    Put this onChange on the estimated value:

    Code Snippet

    var margin = 15;

     

    crmForm.all.new_yournewattribute.DataValue = margin * crmForm.all.estimatedvalue.DataValue / 100;

     

     

     

     

    Thanks for the Code ibbz.

     

    Thanks ibbz and FK..you are awesome. It worked like a charm.

     

    I really appreciate all the help and advice I get from this forum.

     

    Thanks again.

     

    Crm3.0Newbie 

     

     

    Thursday, December 11, 2008 5:52 PM