Skip to main content
March 24, 2025
Solved

a!queryRecordType. Parameter "fields"

  • March 24, 2025
  • 3 replies
  • 0 views

I have the local variable called "encargo" to get a single record from a RecordType filtering by an id key. I want to get all the fields of the record type. Is there any way to tell it to the "fields" parameter or have I to list all of them instead?:

local!encargo: a!queryRecordType(
  recordType: 'recordType!{47dcd902-6450-48f5-944d-06c0f19d2df1}Encargo DSAppian',
  fields: {
    'recordType!{47dcd902-6450-48f5-944d-06c0f19d2df1}Encargo DSAppian.fields.{85cdc5be-fc56-425c-9ec2-f9e617124992}id',
    'recordType!{47dcd902-6450-48f5-944d-06c0f19d2df1}Encargo DSAppian.fields.{48d20aa7-6bfb-42ac-9ea0-0396fafa7ffd}fechasolicitud'
  filters: a!queryFilter(
    field: 'recordType!{47dcd902-6450-48f5-944d-06c0f19d2df1}Encargo DSAppian.fields.{85cdc5be-fc56-425c-9ec2-f9e617124992}id',
    operator: "=",
    value: ri!id
  ),
  pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 1)
).data

Thanks!

    Best answer by mikes0011

    AFAIK when no "fields" parameter is provided, the query automatically returns all fields that directly belong to that record type.  I just double-checked in my 25.1 environment and this behavior seems accurate.

    3 replies

    mikes0011
    mikes0011Answer
    Brainy
    March 24, 2025

    AFAIK when no "fields" parameter is provided, the query automatically returns all fields that directly belong to that record type.  I just double-checked in my 25.1 environment and this behavior seems accurate.

    harshm4411
    March 24, 2025

    Hi [mention:8cdd6119fd07485ea8670348a7dd2045:e9ed411860ed4f2ba0265705b8793d05] ,

    If you want to retrieve all record fields, simply leave the fields parameter empty. By default, it will return all available record fields.

    varuntejg243705
    March 24, 2025

    Hi [mention:8cdd6119fd07485ea8670348a7dd2045:e9ed411860ed4f2ba0265705b8793d05] ,

    In a!queryRecordType, fields parameter is used to get specific record fields with PK field when there are only particular fields needed, if you leave it as nul() or {},  it will automatically return all the fields.

    Also most important thing to consider is when you are using relationships in query, it will help in getting specific fields from related record.

    Hope this helps you!!