Disable Grid Row with record references

Certified Senior Developer

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? 

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    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.