Issue with a!startProcessLink function when using in a!gridField (Version 19.3)

Certified Associate Developer

Hi,

We have upgraded Appian to 19.3 version and removing/updating all the depreciated functions. While upgrading the function a!gridField_19r1() to a!gridField() we started facing as issue. Funtion a!startProcessLink was used in a!gridField_19r1() to trigger process model corresponding to the grid rows by passing parameters. Post upgrade, it is not working as expected. we are able to trigger the process model using !startProcessLink function but the parameters getting passed is not correct. Which ever row you select in the grid it always pass details of last row.

For instance, Consider a grid with 3 fields and ID is the process model input parameter. When we click on 1st or 2nd or 3rd row always last row ID, that is 401 is getting passed to the process model. 

ID Policy Name Process Model Link
101 Pol 1 Edit - 101
201 Pol 2 Edit - 201
301 Pol 3 Edit - 301
401 Pol 4 Edit - 401

Sample Code

a!gridField(

label: "",
data:local!policyPropertyGrid,
pagingSaveInto: local!pagingInfo,

columns: {
a!gridColumn(
label: "Edit" ,
value: a!richTextDisplayField(
           value: a!richTextItem(
                      text: "Edit - " & fv!row.policyId,
                      link: a!startProcessLink(
                              processModel: cons!POL_PROPERTY_PM,
                              processParameters: {
                              policyId:fv!row.policyId }
                              )
                     )
           )
     )
  }
)

Could you please advise.

Thanks,
Abin

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    The code you've posted looks correct assuming I'm not missing something.  Just for comparison could you post the approximately same snippet from the old version that still used the old grid component?  BTW, I recommend when posting code like this, you use "Insert --> Insert Code" from the menu to create a code box and paste the code there, as this retains indentation and generally makes it easier to read.

  • 0
    Certified Associate Developer
    in reply to Mike Schmitt

    Thanks for the reply. Please find the old code below which was working fine.

     a!gridField_19r1(
                  label: "",
                  totalCount: local!policyPropertyGrid.totalCount,
                  columns: { 
                  a!gridTextColumn(
                      label: "Edit",
                      data: a!forEach(
                        items: index(
                          local!policyPropertyGrid.data,
                          "policyId",
                          ""
                        ),
                        expression: "Edit Property"
                      ),
                      links: a!forEach(
                        items: index(
                          local!policyPropertyGrid.data,
                          "policyId",
                          ""
                        ),
                        expression: a!startProcessLink(
                          label: "Edit",
                          processModel: cons!POL_PROPERTY_PM,
                          processParameters: {
                            policyId: fv!item,
                            
                          }
                        )
                    )
                )
            }
            
            value: local!pagingInfo,
            saveInto: local!pagingInfo
        )

  • +1
    Certified Lead Developer
    in reply to abins0001

    Unless there's a typo or something that i'm missing (always a chance), the new version seems correct.  If you can verify this behavior stays the same in a different interface / process model, i suppose it could be a product bug which you could report to Appian.

    Edit to add: I made my own small test app (note this is in Appian 19.4 not 19.3), and it seems to work correctly when I try it.  Here's my interface, and it just points to a simple PM with a single parameter.

    a!localVariables(
      local!items: {
        {
          id: 1,
          name: "apple"
        },
        {
          id: 2,
          name: "orange"
        },
        {
          id: 3,
          name: "strawberry"
        }
      },
      a!sectionLayout(
        label: "Testing",
        contents: {
          a!gridField(
            data: local!items,
            columns: {
              a!gridColumn(
                label: "Item",
                value: fv!row.name
              ),
              a!gridColumn(
                label: "Link",
                value: a!richTextDisplayField(
                  value: {
                    a!richTextItem(
                      text: "(id: " & fv!row.id & ")",
                      link: a!startProcessLink(
                        processModel: cons!TEST_GRID_TARGET_PM,
                        processParameters: {
                          testParameter: fv!row.id
                        }
                      )
                    )
                  }
                )
              )
            }
          )
        }
      )
    )

Reply
  • +1
    Certified Lead Developer
    in reply to abins0001

    Unless there's a typo or something that i'm missing (always a chance), the new version seems correct.  If you can verify this behavior stays the same in a different interface / process model, i suppose it could be a product bug which you could report to Appian.

    Edit to add: I made my own small test app (note this is in Appian 19.4 not 19.3), and it seems to work correctly when I try it.  Here's my interface, and it just points to a simple PM with a single parameter.

    a!localVariables(
      local!items: {
        {
          id: 1,
          name: "apple"
        },
        {
          id: 2,
          name: "orange"
        },
        {
          id: 3,
          name: "strawberry"
        }
      },
      a!sectionLayout(
        label: "Testing",
        contents: {
          a!gridField(
            data: local!items,
            columns: {
              a!gridColumn(
                label: "Item",
                value: fv!row.name
              ),
              a!gridColumn(
                label: "Link",
                value: a!richTextDisplayField(
                  value: {
                    a!richTextItem(
                      text: "(id: " & fv!row.id & ")",
                      link: a!startProcessLink(
                        processModel: cons!TEST_GRID_TARGET_PM,
                        processParameters: {
                          testParameter: fv!row.id
                        }
                      )
                    )
                  }
                )
              )
            }
          )
        }
      )
    )

Children