Assistance in resolving "No primary filter 'feedback' for 'CTrack'" error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DonQuinleone
    Junior Member
    • Dec 2024
    • 2

    Assistance in resolving "No primary filter 'feedback' for 'CTrack'" error

    Hi there,

    I'm setting up EspoCRM to keep track of the recordings that I am working on (I'm a record producer), and am trying to setup some PrimaryFilters to use in Record Lists on the Dashboard that show me a list of tracks that are both currently pending feedback and 'in edit'.

    I have setup a custom entity, CTrack, which has a "status" column - there are quite a few different statuses, but the ones that are relevant here are "Feedback", "QA" and "In Edit".

    Following this guide, I am attempting to setup two new PrimaryFilters that can be used in the Record List dashlet on the Dashboard.

    Under ~/crm/custom/Espo/Custom/Select/CTrack/PrimaryFilters I have created two files:

    Feedback.php:

    PHP Code:
    <?php
    namespace Espo\Custom\Select\CTrack\PrimaryFilters;
    use Espo\Core\Select\Primary\Filter;
    use Espo\ORM\Query\SelectBuilder;
    use Espo\ORM\Query\Part\Condition as Cond;
    
    class Feedback implements Filter {
        public function apply(SelectBuilder $queryBuilder): void {
            $queryBuilder->where(
                Cond::in(
                    Cond::column('status'),
                    ['Feedback','QA']
                )
            );
        }
    }
    InEdit.php:

    PHP Code:
    <?php
    namespace Espo\Custom\Select\CTrack\PrimaryFilters;
    use Espo\Core\Select\Primary\Filter;
    use Espo\ORM\Query\SelectBuilder;
    use Espo\ORM\Query\Part\Condition as Cond;
    
    class InEdit implements Filter {
        public function apply(SelectBuilder $queryBuilder): void {
            $queryBuilder->where(
                Cond::in(
                    Cond::column('status'),
                    ['In Edit','Mixing', 'Mastering']
                )
            );
        }
    }
    And then I have created/modified the following, as instructed in the guide:

    ~/crm/custom/Espo/Custom/Resources/metadata/selectDefs/CTrack.php:

    PHP Code:
    {
        "primaryFilterClassNameMap": {
            "inedit": "Espo\\Custom\\Select\\CTrack\\PrimaryFilters\\InEdit",
            "feedback": "Espo\\Custom\\Select\\CTrack\\PrimaryFilters\\Feedback"
        }
    } 
    
    ~/crm/custom/Espo/Custom/Resources/metadata/clientDefs/CTrack.php:

    PHP Code:
    {
        "controller": "controllers/record",
        "boolFilterList": [
            "onlyMy"
        ],
        "filterList": [
            {
                "name":"inedit"
            },
            {
                "name":"feedback"
            }
        ],
        "sidePanels": {
            "detail": [
                {
                    "name": "activities",
                    "label": "Activities",
                    "view": "crm:views/record/panels/activities",
                    "aclScope": "Activities"
                },
                {
                    "name": "history",
                    "label": "History",
                    "view": "crm:views/record/panels/history",
                    "aclScope": "Activities"
                },
                {
                    "name": "tasks",
                    "label": "Tasks",
                    "view": "crm:views/record/panels/tasks",
                    "aclScope": "Task"
                }
            ]
        },
        "color": "#0ae4b6",
        "iconClass": "fas fa-compact-disc",
        "kanbanViewMode": false,
        "relationshipPanels": {
            "recordingSession": {
                "layout": null,
                "selectPrimaryFilterName": null
            },
            "productionPersonnels": {
                "layout": null,
                "selectPrimaryFilterName": null
            },
            "artists": {
                "layout": null,
                "selectPrimaryFilterName": null
            }
        },
        "dynamicLogic": {
            "fields": {
                "requestSent": {
                    "visible": null,
                    "required": null,
                    "invalid": null
                }
            }
        }
    }

    ~/crm/custom/Espo/Custom/Resources/i18n/en_GB/CTrack.json:

    PHP Code:
    {
        "fields": {
            "recordingSession": "Recording Session",
            "status": "Status",
            "priority": "Priority",
            "productionPersonnels": "Production Personnel",
            "iSRC": "ISRC",
            "name": "Track Title",
            "composers": "Composer(s)",
            "arrangers": "Arranger(s)",
            "forces": "Forces",
            "deadline": "Deadline",
            "waitingOn": "Waiting On",
            "requestSent": "Request Sent",
            "artists": "Artists",
            "stakeholders": "Stakeholders",
            "producerSignedOff": "Producer Signed Off",
            "conductorSignedOff": "Conductor Signed Off",
            "composerSignedOff": "Composer Signed Off",
            "accompanistSignedOff": "Accompanist Signed Off",
            "othersSignedOff": "Others Signed Off",
            "labelSignedOff": "Label Signed Off"
        },
        "links": {
            "recordingSession": "Recording Session",
            "productionPersonnels": "Production Personnel",
            "artists": "Artists"
        },
        "options": {
            "status": {
                "Planning": "06 Planning",
                "Backlog": "05 Backlog",
                "In Edit": "01 In Edit",
                "Feedback": "00 Feedback",
                "Mixing": "02 Mixing",
                "Mastering": "03 Mastering",
                "QA": "00 QA",
                "Approved": "04 Approved",
                "Delivered": "07 Delivered",
                "Cancelled": "99 Cancelled"
            },
            "priority": {
                "P1 (Critical)": "P1 (Critical)",
                "P2 (High)": "P2 (High)",
                "P3 (Medium)": "P3 (Medium)",
                "P4 (Low)": "P4 (Low)",
                "P5 (Trivial)": "P5 (Trivial)"
            },
            "composers": [],
            "arrangers": [],
            "waitingOn": [],
            "stakeholders": []
        },
        "tooltips": {
            "iSRC": "Format: CC-RRC-YY-SSSSS"
        },
        "presetFilters": {
            "inedit": "In Edit",
            "feedback": "Out for Feedback"
        }
    }
    These filters are appearing in the list of options within the Record List dashlet and in the filter dropdown of the CTrack list, but I'm getting the following error when trying to use them:

    No primary filter 'feedback' for 'CTrack'.
    I have cleared the cache and hard reloaded the tab in my browser.

    What am I missing here? This is the last thing that I'm getting setup before I have the perfect system!

    Your help is much appreciated. Thank you!

    ~ Don
  • yuri
    Member
    • Mar 2014
    • 8475

    #2
    Hi Don,

    I think it's because of wrong file extensions.

    selectDefs/CTrack.php => selectDefs/CTrack.json
    clientDefs/CTrack.php => clientDefs/CTrack.json
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • DonQuinleone
      Junior Member
      • Dec 2024
      • 2

      #3
      Wow, of course it was something that simple! How did I not notice that?
      THANK YOU!

      Comment

      Working...