Use refreshVariable with refreshAfter: "RECORD_ACTION" in Task From

Certified Senior Developer

I am trying to use a refreshVariable with refreshAfter: "RECORD_ACTION" in a Task From, but the variable does not get refreshed.

Is the use of refreshAfter: "RECORD_ACTION" only possible in a record form, or am I missing something.

I start my from with:

a!localVariables(
  local!contractVersion : a!refreshVariable(
    value: rule!TML_GetMostRecentContractVersion(ri!contract.id),
    refreshAfter: "RECORD_ACTION"
  ),
  ...
)

And in the middle of the form there is a recordActionField:

a!recordActionField(
        actions: {
          a!recordActionItem(
            action: 'recordType!{eb81a0e8-fa2b-4197-960f-cb29539fee9a}Contract.actions.{f1c42920-fefd-4519-b8f7-7d3e8199868b}newContractVersion',
            identifier: ri!contract.id
          )
        },
        style: "TOOLBAR",
        display: "LABEL_AND_ICON",
        align: "END",
        openactionsin: "DIALOG"
      )

the record action is executing without a problem, but the refreshvarable is not working.

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Hi Mike,

    I just tested when I change to open in same tab. (I actually did not test this before since I was not expecting it to work correctly from a task form)

    When choosing "open in same tab" it works since as you suggest, the complete interface is refreshed.

    This however does not solve the orignal problem / bug. since this refresh mechanism was introduced to be able to use the "open in tab" behaviour

Children
  • 0
    Certified Lead Developer
    in reply to maartenc

    I agree, we do need a way to refresh upon completion of an on-form pop-up dialog; though suddenly i'm unclear if you're referring to the pop-up dialog or the "open in new tab" version, which I don't believe it's feasible to add any autorefreshing behavior to, since the original interface will stay open and unchanged while the action opens in a new tab, and will have no inherent way in knowing when (or even if) the action is completed.

    I haven't had a chance yet to test the autrefresh behavior when completing an action in a dialog -- based on the documentation i'd expect it to work but of course there's always the chance that something isn't working correctly with it.

    The one thing I'd suggest (just in general) is that you should double check that your process model is set to chain all the way through the DB write(s) that affect the value that you're hoping to refresh.  If it's not, then I would expect it might be attempting to refresh *before* the DB write has been completed.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Hi Mike,

    The process model is chained completely.

    When I use "Open in same tab" it refreshes as expected.
    But when I use the new refresh mechanism in combination with open in dialog. (see code snipped above) it does not work.

  • 0
    Certified Lead Developer
    in reply to maartenc

    Ok, thanks for confirming -- this seems like a potential Appian bug, I'll let take it from here I think.