Источник:
https://www.tech.alirazazaidi.com/wo...cs-ax-2012-r3/
==============
Small tip, with reference at the end of post. I got small task, User want Last approval Name in grid at the result.
I wrote following code snippet as method in a required table and bind it to grid field.
X++:
display Name LastApprovalName()
{
WorkflowTrackingStatusTable workflowTrackingStatus;
WorkflowTrackingTable workflowTrackingTable;
WorkflowTrackingCommentTable workflowTrackingCommentTable;
UserInfo userInfo;
RecId _recId;
Name _name;
_recId=5637145391;
select firstFast RecId, User from workflowTrackingTable
order by RecId desc
join workflowTrackingCommentTable
where workflowTrackingCommentTable.WorkflowTrackingTable == workflowTrackingTable.RecId
join UserInfo
where UserInfo.id == WorkflowTrackingTable.User
exists join workflowTrackingStatus
where workflowTrackingTable.WorkflowTrackingStatusTable == workflowTrackingStatus.RecId
&& workflowTrackingStatus.ContextRecId == this.RecId
&& workflowTrackingStatus.ContextTableId == tableNum(MyTablelRequestTable) //PurchTable
&& workflowTrackingTable.TrackingType == WorkflowTrackingType::Approval;
if (workflowTrackingTable.RecId > 0)
{
_name=userInfo.name;
}
else
{
_name='';
}
return _name;
}
Original Code snippet is
https://community.dynamics.com/ax/b/...-approved-date
Источник:
https://www.tech.alirazazaidi.com/wo...cs-ax-2012-r3/