Auto Approve Workflow by Code x++

Example code :

static void TIDF_autoApproveWFOvertime(Args _args)
    WorkflowWorkItemTable WorkflowWorkItemTable;

    while select WorkflowWorkItemTable
        WorkflowWorkItemTable.UserId == '32501112'
    &&  workflowWorkItemTable.Type == WorkflowWorkItemType::WorkItem
    &&  workflowWorkItemTable.Status == WorkflowWorkItemStatus::Pending
    &&  WorkflowWorkItemTable.RefTableId == tableNum(HrsOvertime)
                                    "Auto Approve by ADMIN", // comment
                                    '32501112', // << user ID
                                    "HRSOvertimeApprove", // << menu item action approval workflow
                                    false); //is not web Menu Item



3 thoughts on “Auto Approve Workflow by Code x++

  1. thanks for your code.
    But where and when you will call this code to execute?

    We need it automatically.

    Best Regards,

  2. I want to implement Auto approval in Purchase requisition for particular user group.if i am part of special user group then i need no to clear all stages or this possible if yes how?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s