changing an integer field to a relate field

I created a field for "client_id" which exists across all of my modules, however in the calls module, as well as others I need this field to relate to an accounts module field with similar values. Particularly here I am trying to create a subpanel in the accounts module which will search the "client_id" field of the calls module and return results based on it. However it is coming up blank

Any help would be greatly appreciated. 

Parents
  • There's a guide to how to create a subpanel from a custom query here - https://developer.sugarcrm.com/2015/05/18/creating-subpanels-with-custom-results-in-sugar-7-5/ 

    In your case, the query (in the accounts module) would be something like:

        protected function getCustomJoin($params = array())
        {
            $sql = " JOIN (";
            $sql .= <<<MYCUSTOMQUERY
    SELECT
        calls.id AS my_custom_id
        FROM
            calls
        WHERE
            calls.deleted = 0
            AND calls.client_id = '{$this->focus->client_id}'
    MYCUSTOMQUERY;

            $sql .= ") calls_to_show ON calls_to_show.my_custom_id = calls.id";
            return $sql;
        }
Reply
  • There's a guide to how to create a subpanel from a custom query here - https://developer.sugarcrm.com/2015/05/18/creating-subpanels-with-custom-results-in-sugar-7-5/ 

    In your case, the query (in the accounts module) would be something like:

        protected function getCustomJoin($params = array())
        {
            $sql = " JOIN (";
            $sql .= <<<MYCUSTOMQUERY
    SELECT
        calls.id AS my_custom_id
        FROM
            calls
        WHERE
            calls.deleted = 0
            AND calls.client_id = '{$this->focus->client_id}'
    MYCUSTOMQUERY;

            $sql .= ") calls_to_show ON calls_to_show.my_custom_id = calls.id";
            return $sql;
        }
Children
No Data