How to created Interactive Filter on the Project Number field

Saurabh Singh5
Tera Expert

Hi,

 

We want to create a interactive filter on the project Number field, Not sure if this is possible and also i am very new to the interactive filters.But have a basic idea of things.

 

 

Regards,

Saurabh Singh

6 REPLIES 6

Were you able to find an answer ? Please do reply as I am stuck with the same problem

Hi Aish,

 

I found a workaround i created a Content block on the Dashboard (Screenshot attached) add a new *dynamic content -> add it and click on configure -> Give it a Name and add the script below: (Change the values based on your field value names if required and you can add what ever query you are looking for based on your business)

 

function filterProjects() {
  var projectNum = document.getElementById("project_filter").value;

  if (projectNum) {
    // Filter for pm_project table
    var projectFilter = {
      id: handler._unique_id + "_project",
      table: "pm_project",
      filter: "number=" + projectNum
    };

    // Filter for project_status table using dot-walking
    var statusFilter = {
      id: handler._unique_id + "_status",
      table: "project_status",
      filter: "project.number=" + projectNum
    };

    SNC.canvas.interactiveFilters.setDefaultValue(
      { id: projectFilter.id, filters: [projectFilter] },
      false
    );
    SNC.canvas.interactiveFilters.setDefaultValue(
      { id: statusFilter.id, filters: [statusFilter] },
      false
    );

    handler.publishFilter(projectFilter.table, projectFilter.filter);
    handler.publishFilter(statusFilter.table, statusFilter.filter);
  } else {
    SNC.canvas.interactiveFilters.removeDefaultValue(handler._unique_id + "_project", false);
    SNC.canvas.interactiveFilters.removeDefaultValue(handler._unique_id + "_status", false);
    handler.removeFilter();
  }
}
 

 

Regards,

Saurabh Singh