web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Workflow delegate to new user

(0) ShareShare
ReportReport
Posted on by 30

Hi all,

User has given few journals,  which failed to approve the workflow because the approve no more exist in the organization's. 

GL - General Journals 

So, they provide us new approver name to add. So, that he can the approve those journals.

Note - The particular user I'd and recid from LesgerJournalTable is not found in workflowworkitemTable.

Kindly let me know how will delegate to new user for those journals through x++?

Please give me more shed on this .

Thanks!

I have the same question (0)
  • @rp@n Profile Picture
    30 on at

    Hi all,

    Is it possible to add 2 users for delegated through query ( x++ )

    Please give me more shed on this

  • @rp@n Profile Picture
    30 on at

    Can anyone help me on this pls?

    Its urgent

  • Suggested answer
    B.W Profile Picture
    505 on at

    Hi @rp@n.

    i have used the following code to reassign workflow to a different user in the past. hope this helps.

    static void workflowReassign(Args _args)
    {
          UserId fromUser = "userID1";
       UserId toUser = "UserID2";
    
             //Comment for workflow history
            str comment = "Reassign";
             WorkflowWorkItemTable workitems;
             int i;
              while select workitems where workitems.Status == WorkflowWorkItemStatus::Pending
                  && workitems.UserId == fromUser
                 {
                     WorkflowWorkItem::delegateWorkItem(workitems.Id, toUser, comment);
                     print workitems.Description;
                    i  ;
                  }
    
              pause;
              info(strFmt("Items re-assigned: %1",i));
    }

  • @rp@n Profile Picture
    30 on at

    Thanks BA,

    Shall I add multiples users ( at least 2 ) ? As this is customer requirement. If suppose o ne person is not available then another can approve.

    Please confirm.

  • @rp@n Profile Picture
    30 on at

    Hi BA

    WorkItem is still not created. So, unbale to get the record in WorkflowWorkItem Table

    4760.a1.jpg

    6305.a2.jpg

    4578.a3.jpg

    Kindly suggest me how will add new 2 approvers?, so that they can approve.

    Please give me more shed on this.

    thanks!

  • @rp@n Profile Picture
    30 on at

    can anyone pls send me the script?

  • Suggested answer
    Ramit Paul Profile Picture
    22,797 Most Valuable Professional on at

    Hi,

    Can you once again share how many GL journals are there to delegate?

    Can you not simply recall the WF and reassign the GLs?

  • @rp@n Profile Picture
    30 on at

    Hi Ramit,

    It's about 75 journals

  • @rp@n Profile Picture
    30 on at

    Ramit,

    Customer dont wants to do one by one. They wants to do in bulk.

    Is it possible through workflow configuration , I mean if I add those users with OR condition without any script.

    Please give me more shed on this

  • Suggested answer
    Ramit Paul Profile Picture
    22,797 Most Valuable Professional on at

    Hi,

    I dont think this is possible by configuration as such.

    You need to think of a script to replace the user, this is one of the solution I can think of.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans