Related action in read only grid

Hi All,

I have a scenario where i have to populate related action in one of the column in read only grid. For instance, the row with identifier 1 i will populate related action for identifier 2 in that specific column. The issue am facing is that even though i can open that related action with identifier 2, the name of related action is still showing like related action of identifier 1, 

Note: Am only facing this issue when am using a!recordData as source but I could get desired result when am using a!query record type.

You can try this scenario making one value in column as a!recordActionItem(action: record action, identifier: fv!identifier+1

Please suggest if am missing anything here.

Thanks in advance!

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Can you share some code snippets and a screen shot?

  • 0
    Certified Associate Developer

    Hi 
    Please try below logic in Interface

    a!cardLayout(
      contents: a!gridField(
        data: 'recordType!{1e3f625b-dbca-4db6-969b-950bb182955b}AIS Request',
        columns: {
          a!gridColumn(
            label: "Request ID",
            sortField: 'recordType!{1e3f625b-dbca-4db6-969b-950bb182955b}AIS Request.fields.{c40cd374-cceb-4121-86ce-7375ae9c0c4d}id',
            align: "CENTER",
            value: a!recordActionField(
              display: "ICON",
              actions: a!recordActionItem(
                action: 'recordType!{1e3f625b-dbca-4db6-969b-950bb182955b}AIS Request.actions.{bf974385-c2a4-4c1d-8adb-b712ae80282f}updateRequest',
                identifier: fv!row['recordType!{1e3f625b-dbca-4db6-969b-950bb182955b}AIS Request.fields.{c40cd374-cceb-4121-86ce-7375ae9c0c4d}id']
              )
            )
          ),
          a!gridColumn(
            label: "Description",
            sortField: 'recordType!{1e3f625b-dbca-4db6-969b-950bb182955b}AIS Request.fields.{efca005e-588c-4c84-b7e9-d2d972fa9c74}description',
            value: fv!row['recordType!{1e3f625b-dbca-4db6-969b-950bb182955b}AIS Request.fields.{efca005e-588c-4c84-b7e9-d2d972fa9c74}description']
          )
        },
        validations: {},
        refreshAfter: "RECORD_ACTION",
        showSearchBox: true,
        showRefreshButton: true,
        recordActions: {
          a!recordActionItem(
            action: 'recordType!{1e3f625b-dbca-4db6-969b-950bb182955b}AIS Request.actions.{9fa223ca-faa8-4d94-bcca-1dae1b2f71a4}newRequest'
          )
        }
      ),
      shape: "ROUNDED",
      showShadow: true
    )

    Thank you.

  • Data: a!query record type

    a!localVariables(
      local!rlmLoanDetails: a!queryRecordType(
        recordType: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details',
        filters: {
          rule!ACO_filterEqualsOrIn(
            field: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{2d7edaf4-3e40-41c0-a89a-6f3995670e0e}isActive',
            value: true()
          ),
          rule!ACO_filterEqualsOrIn(
            field: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{259fe683-f6b2-40b5-a60a-d9f9dc27872e}milestone',
            value: cons!RLM_LOOKUP_DATA_157
          )
        },
        pagingInfo: a!pagingInfo(1,5000),
        fields: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.relationships.{4a143561-e223-467d-bb67-c8ee80ed07c0}rlmAdditionalLoanDetail.fields.{6e0272c7-3872-44f0-a65b-d1889e68d550}leadLoan'
      ).data,
    
      a!sectionLayout(
        label: "Managed Loan",
        contents: a!gridField(
          labelPosition: "COLLAPSED",
          emptyGridMessage: "No data available",
          data: local!rlmLoanDetails,
          columns: {
            a!gridColumn(
              label: "Loan number",
              sortField: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{6a018376-f831-413a-af07-3cbbd02d619d}loanNumber',
              value: a!recordActionField(
                actions: a!recordActionItem(
                  action: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.actions.{05cd73c9-ce7f-4dc4-8b3f-5d00258e9b6b}displayLoanSummary',
                  identifier: fv!row['recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{1f75d98b-f357-4136-82a7-bf333120f592}rlmId']
                ),
                style: "LINKS",
                display: "LABEL"
              )
            ),
    
            a!gridColumn(
              label: "Related Loans",
              value: 
                a!recordActionField(
                  actions:  a!recordActionItem(
                      action: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.actions.{05cd73c9-ce7f-4dc4-8b3f-5d00258e9b6b}displayLoanSummary',
                      identifier: fv!row['recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{1f75d98b-f357-4136-82a7-bf333120f592}rlmId']+1
                    ),
                    style: "LINKS",
                    display: "LABEL"
                  ),
                 
              )
           
          
           
          },
          refreshAlways: true(),
          refreshAfter: "RECORD_ACTION",
          pageSize: cons!ACO_GRID_SIZE_TINY
        ),
        isCollapsible: true()
      )
    )




    Result



    Data: a!recordData
    a!localVariables(
      local!rlmLoanDetails: a!recordData(
        recordType: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details',
        filters: {
          rule!ACO_filterEqualsOrIn(
            field: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{2d7edaf4-3e40-41c0-a89a-6f3995670e0e}isActive',
            value: true()
          ),
          rule!ACO_filterEqualsOrIn(
            field: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{259fe683-f6b2-40b5-a60a-d9f9dc27872e}milestone',
            value: cons!RLM_LOOKUP_DATA_157
          )
        },
    
      ),
    
      a!sectionLayout(
        label: "Managed Loan",
        contents: a!gridField(
          labelPosition: "COLLAPSED",
          emptyGridMessage: "No data available",
          data: local!rlmLoanDetails,
          columns: {
            a!gridColumn(
              label: "Loan number",
              sortField: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{6a018376-f831-413a-af07-3cbbd02d619d}loanNumber',
              value: a!recordActionField(
                actions: a!recordActionItem(
                  action: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.actions.{05cd73c9-ce7f-4dc4-8b3f-5d00258e9b6b}displayLoanSummary',
                  identifier: fv!row['recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{1f75d98b-f357-4136-82a7-bf333120f592}rlmId']
                ),
                style: "LINKS",
                display: "LABEL"
              )
            ),
    
            a!gridColumn(
              label: "Related Loans",
              value: 
                a!recordActionField(
                  actions:  a!recordActionItem(
                      action: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.actions.{05cd73c9-ce7f-4dc4-8b3f-5d00258e9b6b}displayLoanSummary',
                      identifier: fv!row['recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{1f75d98b-f357-4136-82a7-bf333120f592}rlmId']+1
                    ),
                    style: "LINKS",
                    display: "LABEL"
                  ),
                 
              )
           
          
           
          },
          refreshAlways: true(),
          refreshAfter: "RECORD_ACTION",
          pageSize: cons!ACO_GRID_SIZE_TINY
        ),
        isCollapsible: true()
      )
    )


    Result


    Am getting same related action label name when am using a!recorddata even though am passing correct identifier. But only label is showing in wrong way, when i click on RA i could open the correct RA.

    Not sure why RA label not displaying properly when using a!recordData as source.

    Below is the way i have configured RA Display name

  • 0
    Certified Lead Developer
    in reply to Capt_Barbosa

    a!recordData is not meant to be used outside of grids. Reference: docs.appian.com/.../fnc_system_recorddata.html

    Why do you increase the identifier by 1?

  • a!recordData is not meant to be used outside of grids. Reference: docs.appian.com/.../fnc_system_recorddata.html

    Yes.  I just declared in local variable and using it in data parameter of read only grid. Even if i directly put a!recordData in data parameter am facing the same issue.


    Why do you increase the identifier by 1?

    I just showed the example. Even if the identifier is changed, the related action display name is not changing if we are using a!recordData as grid source.

  • 0
    Certified Lead Developer
    in reply to Capt_Barbosa

    Did you try to just display the values outside a record action?

  • Not sure if i understood what you mentioned. Anyway I have populated corresponding identifier in separate columns to understand what am passing as identifier for RA. In first row, even it is different identifier, RA display name is same. 


    Please let me know if this is helpful

    If i just change the source of data by using a!queryrecordtype instead of a!record data, am getting desired result as shown below

  • 0
    Certified Lead Developer
    in reply to Capt_Barbosa

    Does any of these columns include your "+1" logic?

    , is that something you can help us with? It really seems weird.

  • To demonstrate am using +1 logic in all columns. Sharing code below

    a!gridField(
      emptyGridMessage: "No data available",
      data: a!recordData(
        recordType: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details',
        filters: {
          rule!ACO_filterEqualsOrIn(
            field: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{2d7edaf4-3e40-41c0-a89a-6f3995670e0e}isActive',
            value: true()
          ),
          rule!ACO_filterEqualsOrIn(
            field: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{259fe683-f6b2-40b5-a60a-d9f9dc27872e}milestone',
            value: cons!RLM_LOOKUP_DATA_157
          )
        },
    
      ),
      columns: {
        a!gridColumn(
          label: "Loan Number Identifier",
          value: fv!row['recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{1f75d98b-f357-4136-82a7-bf333120f592}rlmId']
        ),
        a!gridColumn(
          label: "Loan number",
          sortField: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{6a018376-f831-413a-af07-3cbbd02d619d}loanNumber',
          value: a!recordActionField(
            actions: a!recordActionItem(
              action: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.actions.{05cd73c9-ce7f-4dc4-8b3f-5d00258e9b6b}displayLoanSummary',
              identifier: fv!row['recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{1f75d98b-f357-4136-82a7-bf333120f592}rlmId']
            ),
            style: "LINKS",
            display: "LABEL"
          )
        ),
        a!gridColumn(
          label: "Related Loans Identifier",
          value: fv!row['recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{1f75d98b-f357-4136-82a7-bf333120f592}rlmId'] + 1
        ),
        a!gridColumn(
          label: "Related Loans",
          value: a!recordActionField(
            actions: a!recordActionItem(
              action: 'recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.actions.{05cd73c9-ce7f-4dc4-8b3f-5d00258e9b6b}displayLoanSummary',
              identifier: fv!row['recordType!{b4241a8a-8490-4326-9a66-74ae61f7935f}RLM Loan Details.fields.{1f75d98b-f357-4136-82a7-bf333120f592}rlmId'] + 1
            ),
            style: "LINKS",
            display: "LABEL"
          ),
    
        )
      },
    
    )


    It doesn't need to be adding +1 to identifier. Even if i pass any random identifier for related action, the display name of RA remains same like specific row's RA.

  • 0
    Certified Lead Developer
    in reply to Capt_Barbosa

    The problem with that "+1" logic is, that it complicates the whole topic unnecessarily. And you want others to be able to reproduce that issue easily.