Filters on Record Type data by its length

Certified Senior Developer

Hi, 

I am using a Record Type, and it has years of existing data. Unfortunately, the active data is identified by the length of the column name "uniqueFieldId", which is a text value so there is no consistency. Note, this is not a primary key in the table. The active field length must be 5 characters long. Anything greater or less is not considered active. Since it has years of existing data, we do not want to insert a new column, as I was thinking the easiest solution would be run a sql inserting an isActive column and then running the filter on it. 

Now, my requirement is to use a record type, and filter the data. I am unsure how I can use record filters to ignore data by the length of the characters in the uniqueFieldId.

The record type is then being used in a readonly grid. A gist of the code below, the aggregation below is necessary as there are other fields and calculations I am doing using relationships to this record type. 

In a gist, is there a way, I can filter a column data by its length. 

Code - 

a!queryRecordType(

recordType: recordType!DataTest,

fields: {

a!aggregationFields(

groupings: a!grouping(

field: recordType!DataTest.Relationship.DataTest2.UniqueFieldId,

alias: "UniqueFieldId"

)

)

}

)

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Senior Developer
    in reply to Mathieu Drouin

    Actually it worked today! I am unsure why it kept giving me the pink screen yesterday. I was trying to do the same. It kept giving me the error, unsure if it was maybe not synced, I am unable to reproduce the error - "a!queryRecordType, the filters does not exist on the queried record type. Only fields from the queried record type are allowed to be filter" 

    Anyways, thank You for the help Mathieu!