Posts Tagged ‘ workflow

Dynamics 365 Finance and Operations Yeni Bir İş Akışı Nasıl Oluşturulur?

Bu yazıda Dynamics 365 Finance and Operations yeni bir iş akışı (Workflow) nasıl oluşturulur anlatmaya çalışacağım. Öncelikle yeni bir tablo ve formumuz olmalı ben örnek olsun diye FDActivityType tablosunu kullanacağım.  Adımlar halinde anlatacağım.

Resim-1

Read more

Ax’ta yeni bir iş akışı ataması oluştuğunda aynı kullanıcının bu iş akışı için daha önce onayı var mı tespit etmek

Merhaba

İş akışında yeni bir atama oluştuğunda atanan kişinin aynı iş akışında daha önce onayı var mı diye kontrol etmek için aşağıdaki metodu kullanabilirsiniz. Bu metodu WorkflowTrackingTable’ a yazdım ama farklı bir yere de yazılabilir. İş akışı altyapısı biraz karışık standart yapıyı değiştirirken dikkatli olmakta fayda var.


Boolean dmrExistApprove()
{
    boolean ret = false;

    WorkflowTrackingStatusTable     workflowTrackingStatus;
    WorkflowTrackingStatusTable     workflowTrackingStatusExist;
    WorkflowTrackingTable           workflowTrackingTable;
    ;

    workflowTrackingStatusExist = WorkflowTrackingStatusTable::findRecId(this.WorkflowTrackingStatusTable);

    select firstOnly RecId, User from workflowTrackingTable
    exists join workflowTrackingStatus
    where  workflowTrackingTable.WorkflowTrackingStatusTable == workflowTrackingStatus.RecId
        && workflowTrackingTable.TrackingType       == WorkflowTrackingType::Approval
        && workflowTrackingTable.User               == this.User
        && workflowTrackingTable.RecId              != this.RecId
        && workflowTrackingStatus.ContextRecId      == workflowTrackingStatusExist.ContextRecId
        && workflowTrackingStatus.InstanceNumber    == workflowTrackingStatusExist.InstanceNumber
        && workflowTrackingStatus.ContextTableId    == workflowTrackingStatusExist.ContextTableId
        && workflowTrackingStatus.TrackingStatus    != WorkflowTrackingStatus::Cancelled ;

    if(workflowTrackingTable.recid)
    {
        ret = true;
    }

    return ret;
}

Selamlar.

İş akışı onayını koddan yapmak

Merhaba

Ax2012′de iş akışını onaylamak için aşağıdaki örnek kodu kullanabilirsiniz.


static void FD_WorkflowWorkItemTable(Args _args)
{

    WorkflowWorkItemTable WorkflowWorkItemTable;
    ;

    WorkflowWorkItemTable = WorkflowWorkItemTable::findRecId(123434343);

    if(WorkflowWorkItemTable)
    {
        ttsBegin;
        WorkflowWorkItemActionManager::dispatchWorkItemAction(
           WorkflowWorkItemTable, // Work item record for which the action is being taken
           strFmt("Auto Approve by %1 ", curUserId() ), // Comment associated with this action
           curUserId(), //The target user of the action
           WorkflowWorkItemActionType::Complete,//The work item action type to take
           "PurchTableApprovalApprove", // The name of the menu item from which the action originated
           false // Flag denoting if this request originated from web or rich client
           );

        ttsCommit;
    }
}

Selamlar.