Hi,
I'm trying to access a RecordType I've created in an interface.
To do this, I've created my Gridfield and added all the RecordType columns. I did the same with index.Now, that the grid is well displayed, is there any way to set the value of default filters or user filters?
or enable/disable one of them please?
I find it hard to imagine that my RecordType grid can be filtered only by a manual user action... I hope not.
Any help would be greatly appreciated.
Regards
Discussion posts and replies are publicly visible
It's only possible to define the default value for a user filter in the record type - it's not possible to define this on the fly when referencing the user filter in a grid. Granted, the default option in the record type can accept an expression, so you could create some more advanced logic if you'd like.
I also can't quite tell based on the discussion above though: do you need to define a default value for the user filter or just apply a filter to the grid without the user being able to change it? If it's the latter, you can define a filter in the data source using the a!recordData() function like this:
a!gridField( label: "Read-only Grid", labelPosition: "ABOVE", data: a!recordData( recordType: 'recordType!{ccd1a746-9707-4f92-b9d7-0d83c6ff7854}Customer', filters: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: 'recordType!{ccd1a746-9707-4f92-b9d7-0d83c6ff7854}Customer.fields.{status}status', operator: "=", value: "Open" ) }, ignoreFiltersWithEmptyValues: true ) ), columns: {...} )
Thanks a lot Peter, it is exactly what I was looking for.I'm sure this will help, as my grid has to be dynamically filtered from others sources (like another grid or specific values that can be dynamic)
Can you confirm it still in the same way, till now we cannot give a filter value on the fly, or if it change, how can I achive it?
Still Same. Either use Default Option in recordtype Object or Manipulate data during Query & using custom filter interfaces
eyleenm8832 It is not possible directly, however, I have tried to explain adding custom filters in this blog post