live update not working after workflow

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamie
    Member
    • Aug 2025
    • 49

    #1

    live update not working after workflow

    Hello,

    I’m encountering unexpected behavior with a linked field in my workflow.

    Workflow setup:
    • On user change, update both address and country.

    Observed behavior:
    1. The address field updates correctly every time.
    2. The country field:
      • Clears itself initially.
      • Displays the ID of the country record instead of the country name.
      • On the next user change, it displays the name, but for the previous country instead of the current one.
      • After refreshing the page, the correct country name displays as expected.

    Steps taken:
    • Tested using both field actions and scripting.
    • The same issue occurs in both cases.

    Issue:
    The country field does not live-update correctly and requires a page refresh to display the expected value.


    Is there a recommended way to ensure the linked country field updates live without refreshing?

    Thanks in advance for your guidance.


    Here is my workflow
    Click image for larger version  Name:	image.png Views:	5 Size:	23.4 KB ID:	121245
    Click image for larger version  Name:	image.png Views:	5 Size:	27.2 KB ID:	121247
    Attached Files
    Last edited by jamie; 09-10-2025, 11:56 AM.
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9360

    #2
    Hi,

    I could not reproduce yet. Could you provide more detail steps to reproduce and/or a more simpler reproducible case?
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • chrisgood
      Junior Member
      • May 2022
      • 10

      #3
      Hi, I'm one of Jamie's work colleagues.

      We have a workaround. Adding the line:

      Code:
      record/relate('Case', id, 'cCountryShipping', account.countryShippingId)
      to the beforeSave custom formula causes the linked entity name to appear without refreshing the page when the record is saved. Therefore, on our espo instance, the issue appears to be running the record\relate after the save rather than before it.

      Steps to Reproduce:
      • Create custom entity and add a couple of records
      • Link Accounts and Case to custom entity using many-to-one relationship
      • Populate new linked custom entity field in account record with a custom entity record
      • Populate a couple of records in Case entity, including the new linked field
      • Add a workflow on Case entity triggered on create/update. Add a filter to the workflow so that it triggers on change of account.
      • add
        Code:
        record/relate('Case', id, 'linkName', account.linkId)
        as action on workflow
      • Go into Case record and change linked account and save the record
      Observed Behaviour:
      • The linked entityId changes as expected (and is sometimes displayed in the linked field on the case) but the diisplayed linked entity name doesn't change until the page is refreshed
      If the beforeSave formula is used instead, the linked entity name does change without a page refresh.

      Comment

      • yuri
        EspoCRM product developer
        • Mar 2014
        • 9360

        #4
        Hi,

        It's a known limitation. Calling that function does not trigger the context record refreshing.

        > to be running the record\relate after the save rather than before it.

        It must run after save. It cannot run before.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • yuri
          EspoCRM product developer
          • Mar 2014
          • 9360

          #5
          As a workaround, you can set proper link names with formula:

          Code:
          myLinkName = account.linkName.
          This field is non-storable, does not affect anything other than what data will be loaded for the view.
          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

          Comment

          Working...