Skip to main content
eddym0001
September 7, 2021
Question

Troubles with record type

  • September 7, 2021
  • 11 replies
  • 0 views

Hello everybody,

I need to create a view using two record type (expense and expenseInfo) that have a field in common (PK and FK)

I have created a query that returns all the information from the two tables using the relation with the id (AT Expense Information) and the idexpensedet (AT Expense).

In the first part I need to show the requester information (That one is ok.)


In the second part of my view I need to populate a Grid ONly Read with all the expense related to the requester. And I don't no know how to do this,

I have tried to test in the grid Only Read (data source: using RULE (call the expression and testing ) and EXPRESSION (with this code) ) it is not working

 

a!queryRecordType(
  recordType: 'recordType!{854cabc5-d20e-4764-95c5-5e0485f3715f}AT Expense Report',
  filters: a!queryFilter(
    field: 'recordType!{854cabc5-d20e-4764-95c5-5e0485f3715f}AT Expense Report.fields.{277d529f-c83c-47ea-a269-f1eec6e4a2d3}idexpensedet',
    operator: "=",
    value: ri!id 
  ),
  pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 100
  )
   
).data

Could you help me, please?

    11 replies

    marco.amador
    September 7, 2021

    When you isolate this call to a!queryRecordType() within a rule, and you test it, what does it return? Does it give you an error or simply has 0 results? 

    As a basic call to a!queryRecordType() the code looks fine to me, although it would give an error if you pass a null value into ri!id. You'd need to specify the applyWhen condition in order for that filter to only have effect when you have a value for ri!id.

    Depending on the Appian version you're running on, you might want to explore the record based grids instead (using a!recordData to configure the grid data) and leverage the features that come with it.

    eddym0001
    eddym0001Author
    September 7, 2021

    Hello @Marco Amador

    When you isolate this call to a!queryRecordType() within a rule, and you test it, what does it return? Does it give you an error or simply has 0 results? 

    Here is working , I get result, but when , I used it to populate the grid, is not working

    BR

    marco.amador
    September 7, 2021

    Can you share how are you trying to populate the grid? Thanks