Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Location
    Florida
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Java Script Multiplication With CRM 30

    I need to script out some multiplication, but am having an issue, and cant seem to figure out why this is not working.

    var sqrnow = (crmForm.all.new_esc_squarefeet.DataValue);
    if (isNaN(sqrnow))
    alert(' not a number');
    var results = (3 * sqrnow);
    crmForm.all.new_esc_squarefeet.DataValue = results;

    Basically what i want to do is take the crmForm.all.new_esc_squarefeet.DataValue and multiply it by 3 then put that number into crmForm.all.new_esc_lightingrecpsqftx3w.DataValue

    this isnt working for me... Any help would be appreciated.

    Thanks in advance

  • #2
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts
    what is : crmForm.all.new_esc_squarefeet.DataValue

    what is the document type of your file? html, xml, ect....?

    that does not look familiar to me.

    could you post you whole source code please....
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

  • #3
    New to the CF scene
    Join Date
    Nov 2006
    Location
    Florida
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    crmForm.all.new_esc_squarefeet.DataValue
    is a NVARCHAR value on a Microsoft CRM Form, So If I wanted to change a value of one field to another on the form I would do it like this

    crmForm.all.new_field.DataValue = crmForm.all.new_field2.DataValue

    and thats all I would have to write.

    If I wanted to say run a script that changed a field based on values I would write something like this

    var sqrnow = (crmForm.all.nsi_squarefootage.DataValue);
    if (isNaN(sqrnow))
    alert(' not a number');
    else if(sqrnow<2000)
    crmForm.all.nsi_leadranking.DataValue="3";
    else if(sqrnow>=2000 && sqrnow<5000)
    crmForm.all.nsi_leadranking.DataValue="2";
    else if(sqrnow>=5000)
    crmForm.all.nsi_leadranking.DataValue="1";

    I hope this helps you help me with multiplying my fields

    Thanks

  • #4
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts
    lol, i dont do drm forms. that would explain why it doesnt lok familiar to me.
    all i can do is to suggst throwing in alerts. like alert the value of your var right after you set it. ect....



    is it just not working or is it causing errors?
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •