+ $this->_multiRecordDisplay = CRM_Utils_Request::retrieve('multiRecordDisplay', 'String', $this);
+ if ($this->_cdType || $this->_multiRecordDisplay == 'single') {
+ if ($this->_cdType) {
+ $this->assign('cdType', TRUE);
+ }
+ // NOTE : group id is not stored in session from within CRM_Custom_Form_CustomData::preProcess func
+ // this is due to some condition inside it which restricts it from saving in session
+ // so doing this for multi record edit action
+ CRM_Custom_Form_CustomData::preProcess($this);
+ if ($this->_multiRecordDisplay) {
+ $this->_groupID = CRM_Utils_Request::retrieve('groupID', 'Positive', $this);
+ $this->_tableID = $this->_entityId;
+ $this->_contactType = CRM_Contact_BAO_Contact::getContactType($this->_tableID);
+ $mode = CRM_Utils_Request::retrieve('mode', 'String', $this);
+ $hasReachedMax = CRM_Core_BAO_CustomGroup::hasReachedMaxLimit($this->_groupID, $this->_tableID);
+ if ($hasReachedMax && $mode == 'add') {
+ CRM_Core_Error::statusBounce(ts('The maximum record limit is reached'));
+ }
+ $this->_copyValueId = CRM_Utils_Request::retrieve('copyValueId', 'Positive', $this);