Senin, 22 Juni 2020

How to get last Approval

static void dtGetLastApproverName(Args _args) 
 { 
    WorkflowTrackingStatusTable workflowTrackingStatus; 
    WorkflowTrackingTable workflowTrackingTable; 
    WorkflowTrackingCommentTable workflowTrackingCommentTable; 
    UserInfo userInfo; 

    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 == _salesRecId //PurchRecID 
    && workflowTrackingStatus.ContextTableId == tableNum(SalesTable) //SalesTable 
    && workflowTrackingTable.TrackingType == WorkflowTrackingType::Approval; 

    if (workflowTrackingTable.RecId > 0) 
    { 
      info(strFmt(“%1 – %2 “,userInfo.name, workflowTrackingCommentTable.RecId)); 
    } 
 } 

You can get this code from : https://allaboutax.blogspot.com/2018/06/retrieve-last-approver-name-for-workflow.html?showComment=1592880782308#c5936258997657022271


Tidak ada komentar:

Posting Komentar

Cloud hosted environment di D365

Biasanya kita menginginkan sebuah environment yang sama dengan LIVE/PROD untuk mengtest sebuah proses. Maka kita bisa menggunakan fitur Clou...