Filtering Records

I have a page that shows the details of a Job Candidate, from a JobCandidates SQL table. I am trying to create a Notes area that shows phone calls made. It refers back to a Notes table.

I am trying to have a DataGrid under the Job Candidate form that shows only calls made to that particular Job Candidate, based on JobCandidates.JobCandidateID and Notes.JobCandidateID.

The problem is when I pull up a Job Candidate, it shows all Notes for every Job Candidate. I think there is a way to do this with a parameter but I could not find the documentation where to specify that and what the format should look like. I saw some examples of how to pass the ID of a row selected, but not from the actual ID of the JobCandidate that the page is currently displaying.

Any help would be greatly appreciated.

Thanks!

Chadrick

  • Edited from CallLogs to Notes

Hi Chadrick,

There are two ways to achieve your goal:

  • To pass JobCandidateID to the Job Candidate page similar to what we do in auto-generated edit pages. We pass the ID as parameter to edit page when you click on particular record in main page with the DataGrid and we use GetByXXX method to retrieve single record by id.
  • Get all records and use $filter parameter to filter them. The format of the $filter is OData, for example: JobCandidateID eq 1

Best Regards,
Vladimir

I definitely am trying to do it the first way, where the results are filtered server-side instead of loading everything and then filtering out afterward.

Adding Notes to objects is a cornerstone of the small app I'm trying to build but I seem to be having a lot of trouble with this.

Here's a quick little rough sketch of what I'm trying to accomplish:

What I'm trying to do so far is:

  1. Drag DataGrid tool to page
  2. Highlight the newly created DataGrid
  3. In Properties, select "New" in Data.
  4. Select "getNoteByNoteID" (I don't see a "getNoteByJobCandidateID" option)
  5. In Response, select "JobCandidateID" (In this moment, the Operation seems to automatically change from "getNoteByNoteID" to "getJobCandidateByJobCandidateID for some reason)
  6. Go to Events
  7. Open LoadData dialog
  8. In LoadData, Properties, Type, select "Invoke data source method"
  9. Select "getNoteByNoteID"
  10. Press add button in Parameters
  11. Enter $filter as Name
  12. Enter ${parameters.JobCandidateID} as Value

This causes nothing to load in the Notes DataGrid. If I change the Operator to GetNotes, it displays all notes for every JobCandidate.

I've looked over the https://www.radzen.com/documentation/datagrid/ several times but it does not seem to be the exact same thing because this has one page with objects on it (the JobCandidates Edit Form and the Notes DataGrid). Also, the printscreens seem to be in an older version of Radzen that doesn't use the same dialog menu for the Event properties.

As always, any assistance would be appreciated.

Thanks!
Chadrick

Hi,

Both methods described in my previous reply will filter data server-side. Parameter $filter can be selected from DropDown on collections returned by methods like GetCusomers. GetByXXX methods will return single value. More info about OData and query parameters can be found here:
http://www.odata.org/getting-started/basic-tutorial/

Best Regards,
Vladimir

1 Like

@Chadrick are you trying to filter the Notes table by JobCandidateID? If yes you can try data-binding the DataGrid to getNotes and set the $filterparameter to JobCandidateID eq ${parameters.JobCandidateID}.

This assumes the current page is generated by Radzen where ${parameters.JobCandidateID}.

If you need further assistance please send us the meta directory of your Radzen application to info@radzen.com

1 Like

Hey Enchev and Korchev,

Thanks for both responses.

I tried to add the $filter parameter to JobCandidateID eq ${parameters.JobCandidateID} but it is still displaying all Notes, even for other JobCandidateIDs.

This image shows that it is showing Notes for JobCandidateID 2, even though it is presently on JobCandidateID 1.

Maybe I added the $Filter in the wrong spot?

I emailed the Meta data to Info.

Thanks again!
Chadrick

I received a response email after Support reviewed the Meta folder advising to add a filter in when invoking the getNotes method in the Page Load event which initially data-binds the grid.

To try to do this, I did the following steps:

  • Open the page
  • In the top right-hand corner, change Selection to Page
  • Clicked the button to open the Events dialog next to Load
  • Go to Invoke Project.getNotes
  • Add parameter
  • Add parameter name $filter
  • Add value JobCandidateID eq ${parameters.JobCandidateID}

After doing this, my page is now only showing Notes that match to the JobCandidateID.

Thanks so much!
Chadrick

1 Like