Record

Certified Senior Developer

Hello,

I am trying to create filters using expression for entity backed records. I created record for entity employee . Now trying to create expression filter for the employee record using the entity department. When I use facet option , department values are loaded and the filters are available. But when I try to filter employee record using the one of the filter options department,  I am getting the message Field is not available.  I am looking for some clarification whether filter on the Entity Employee cann't be filtered using the filter from another entity department.

Reason for using the department entity is , this will have only department names, but employee  entity contains more records. Current there is no relationship between Employee and department entities. Please let me know  whether relationship between employee and department  need to be created or is there any other to resolve this .

  Discussion posts and replies are publicly visible

  • Hi Barat, As per my understanding you want to display the dynamic filters in the record. For that u have used facet option.
    Now
    a!facetOption(
    id: ri!id,
    name:/* This will be displayed to the End User */
    filter: a!queryFilter(
    field: /* Please write your Department field present in the Employee CDT */,
    operator: "=",
    value: /* Pelase write your Department Value that you are getting from Department CDT */
    )
    )
    Now your "Employee" CDT has
    Id Name Department
    101 xyz HR
    102 abc Marketing
    103 pqr Testing

    Now your "Department" CDT has

    ID Name
    1121 HR
    1122 Marketing
    1123 Testing
    In this case

    a!facetOption(
    id: ri!id,
    name:ri!Department.Name
    filter: a!queryFilter(
    field: "Department",/*ri!Employee.Department*/
    operator: "=",
    value: ri!Department.Name
    )
    )

    In this way, the Department value will be searched in the Employee CDT for Department.

    Please let us know if you still cannot understand this