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.
Hello aayushii ,
Can you show us what you have in the submit manager class?
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.
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.
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?
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
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.
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.
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
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?
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156