Skip to main content
New Participant
November 9, 2022
Question

Disable Grid Row with record references

  • November 9, 2022
  • 7 replies
  • 2 views

In a gridField() fed by record data, when you try to use the disableRowSelectionWhen param, record references fail to be evaluated. As an example, we were trying to disable row selection based on a date time in the record data. Originally we had it wrapped in a todate() so we could compare it to a date, but the logic was failing to disable the desired rows. Just for fun we removed the todate() around the record field reference, only to be smacked with an error about not being able to compare Null to a date. That's right, the record reference evaluated to Null. For more fun, we tried using fields that were not dates, and the same thing happened on integer fields, i.e. the record reference evaluated to Null.

Has anyone else run into this? 

7 replies

stefanhelzle0001
Brainy
November 9, 2022

Do you have a code example I could test?

New Participant
November 9, 2022

a!gridField(
  emptyGridMessage: "No Items to Review",
  /*The parameter type is a record list*/
  data: ri!PPA_AuthorizationLineList,
  columns: {},
  selectable: true(),
  disableRowSelectionWhen: fv!row['recordType!{952b38c0-40de-46c5-a845-47f74b38cc1f}PPA Authorization Line.fields.{927e774b-1214-46bb-8ea4-11976a54547f}CreateDate'] > local!originalDeterminationDate
)

Not sure how much use that will be, but hopefully it adds more context. The data param is being passed in from a parent interface as a record type list. But you could also set it to the result of an a!queryRecordType() and get the same result.

mikes0011
Brainy
November 9, 2022

I just whipped up a simplified example but it seemed to work for me?  Or are you saying it's particular to date-type fields?

edit to add: i added a datetime comparison to my logic and that still seems to work ok.

The Expression Guru
New Participant
November 9, 2022

In our case, the grid is being fed by a rule input of type record list, which is passed down from a parent interface. But we also tried replacing the RI with an a!queryRecordType() and got the same results. 

mikes0011
Brainy
November 9, 2022

can you include a screenshot of the code you're trying?

The Expression Guru