Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

workflow display value and workflow status are not in sync

(0) ShareShare
ReportReport
Posted on by 129

Hi.

I have created a new display field which stores the value of name of approval of workflow when the workflow is in Review status. But I can see that it takes time to change the status of the workflow but display method value changed immediately.

for example:

scenario of display method :

Inreview---- "name A"

other than Inreview---- "Blank"

but i can see:

draft---blank

Inreview--blank

after few min : inreview--- "name A"

we want both the changes display method and status on workflow change samentaneously.

  • Komi Siabi Profile Picture
    Komi Siabi 12,759 Most Valuable Professional on at
    RE: workflow display value and workflow status are not in sync

    Hello aayushii ,

    Can you show us what you have in the submit manager class?

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: workflow display value and workflow status are not in sync

    Hi aayushi,

    Name of the approver will get assigned after the work item is created. After creation of the work item only, workflow status will get updated. So, I think there will be delay in getting the updated status.

    Also, I don't think there won't be any issue with display method you have written.

    Thanks,

    Girish S.

  • Komi Siabi Profile Picture
    Komi Siabi 12,759 Most Valuable Professional on at
    RE: workflow display value and workflow status are not in sync

    Dear aayushii,

    Please, next time use the Use rich formatting when pasting code for us to read.

    I believe this is continuation of a process from this thread.

    https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/486116/workflow-step-name

    This is what I feel is happening. 

    * Immediately after the workflow is submitted - You are changing the workflow status to "In review" even when a work item has not been created yet.

    Can you please confirm that?

  • Anton Venter Profile Picture
    Anton Venter 19,493 Super User 2025 Season 1 on at
    RE: workflow display value and workflow status are not in sync

    Thanks for showing the code. If the display method is on the table, it cannot have a parameter or argument. If you remove the parameter, you can refer to the table buffer fields using "this" e.g. this.<YourFieldName> etc, If the display is in the datasource of form, it must have a parameter.

    Have a look at the article below which explains this a bit more:

    Using the display Method Modifier

    https://learn.microsoft.com/en-us/dynamicsax-2012/developer/using-the-display-method-modifier

  • aayushii Profile Picture
    aayushii 129 on at
    RE: workflow display value and workflow status are not in sync

    I have added the display method on tbale level and then use it on form, I have also passed the table name on display method

    code is :  public display str pendingapprovalname(RequestTable  _RequestTable)

       {

           WorkflowTrackingStatusTable workflowTrackingStatusTable;

           WorkflowTrackingTable  workflowTrackingTable;

           WorkflowWorkItemTable workitem;

           select workitem where workitem.RefRecId == _RequestTable.Recid

               && workitem.RefTableId == _PTPTORequestTable.TableId

               && workitem.Status == WorkflowWorkItemStatus::Pending

           join WorkflowTrackingStatusTable

               where WorkflowTrackingStatusTable.CorrelationId == workitem.CorrelationId

           join workflowTrackingTable  order by RecId desc

               where workflowTrackingTable.WorkflowTrackingStatusTable == workflowTrackingStatusTable.RecId

              && workflowTrackingTable.TrackingContext == WorkflowTrackingContext::Step;

           return workflowTrackingTable.Name;

    }

    using the above disply method in form where workflow is enable.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,971 Super User 2025 Season 1 on at
    RE: workflow display value and workflow status are not in sync

    Hi aayushii,

    If you have created the display method on a form, you would need to add a parameter for passing the record to use as source. If the replies from Anton and me are not helping you directly, please share the technical details how this display method was added.

  • aayushii Profile Picture
    aayushii 129 on at
    RE: workflow display value and workflow status are not in sync

    Hi Anton,

    I can see that while fetching the name I am using worflow status example: if status is in review then only display the name of step

  • Anton Venter Profile Picture
    Anton Venter 19,493 Super User 2025 Season 1 on at
    RE: workflow display value and workflow status are not in sync

    Logically speaking and just guessing, it would seem your display method is getting the name value from a different source than from what you are "seeing". The workflow data is updated by the workflow batch job and that's of course where the delay is from. Assuming that what I think is true (different sources), perhaps you can change your display to use the same data?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,971 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans