Troubles with record type

Certified Associate Developer

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?

  Discussion posts and replies are publicly visible

Parents
  • 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.

Reply
  • 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.

Children