Custom Javascript Function on DateTime Field

Hello Folks,

Its nice to be here. Thanks to Sugar for being so closed to their Community.

I am stuck in middle of one functionality requiring javascript onchange function on datetime field.

It involves some calculation and autofilling other fields based on this. I have found some old threads 

regarding this challenge but could not get much out of it.

Hey Sugar Heroes, please help me out on this. Any help would be appreciated.

Many Thanks.

Hats.
Parents
  • Sorry I should have said you need to do a repair after editing the file

    Don't  edit  /include/SugarFields if you need to change thes files you can create a new one in custom/include/Sugarfields but it shouldn't be necessary

    If after doing a repair and it still doesn't workt hen test it by putting something like alert(0) in your onchange to see if is being called

    What version of Sugar are you using this technique certainly works in 6.5

    Can you post the code from your editviewdefs file so I can have a look at whats wrong
  • Hi Mike,

    Thanks for this.

    I am using SugarPro 6.5.14.

    Here is how my code looks like -> 

    name' => 'vacation_start',
    'label' => 'LBL_VACATION_START',
    'displayParams' =>
    array (
    'field' =>
    array (
     'onChange' => 'calculate();',
     ),
    ),

    I found it calls onchange js function which overrides the user defined onchange function.

    Regards.

    Hats
Reply Children
No Data