Problem with setting the default for a custom value in the buildForm hook
Value is present on AJAX form. Solution:

            function webform_membership_civicrm_buildForm($formName, &amp;$form) {

                if (($formName == 'CRM_Activity_Form_Activity') || ($formName == 'CRM_Custom_Form_CustomDataByType')) {

                    if (in_array($form-&gt;getAction(), array(0,1,2))) {

                        //$defaults['custom_8_-1'] = 710;
                        //$form-&gt;_groupTree[4]['fields'][8]['element_value'] = 111;

                        foreach ($form-&gt;_elements as $index =&gt; &amp;$element) {
                            if ($element-&gt;_attributes['data-crm-custom'] == 'Points_for_this:Points') {
                                $element-&gt;_attributes['value'] = 115; // Set custom value here
                            }
                        }
                    }
                }
            }