Notifications
Announcements
No record found.
Hi expert,
I read this post about 'RunAs' method in Dynamics 365 FO
https://www.theaxapta.com/2019/05/runas-in-dynamics-365-fo.html#:~:text=To achieve this we can,workflow submission for another user
Can't understand where should i write this part of code
WorkflowUser submitUser = DirPersonUserEx::worker2UserId(purchReqTable.Originator); container parm = [workFlowTypeStr(PurchReqReview), purchReqTable.RecId, wfComment, NoYes::No, submitUser]; RunAs(submitUser, classNum(myClass), staticMethodStr(myClass, SubmitToWorkflow), parm); CodeAccessPermission::revertAssert();
Hi,
What is your exact requirement here?
RunAs is used to execute the code with the security context of another user. Are you trying to execute the "SubmitToWorkflow" function as the Originator of the purchase requisition workflow?
Hi Gunjan Bhattacharyya,
Yes I'm working in the same scenario
From where do you want to execute this? Do you have a batch job where you want to submit these purchase requisitions?
Please forget about my previous answer.
I have a custom payroll and it's work perfect there is a loan transaction in this payroll
The scenario is
HR creates the loan for employee "X" and submit the workflow
I need the workflow work like that
HR submit --> workflow go to "X" manager --> then go to the HR manager
how can I do this in workflow
Have you checked this link already? Looks similar to your requirement.
Moved to the Dynamics 365 Finance forum.
Thanks work for me
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 559 Most Valuable Professional
André Arnaud de Cal... 464 Super User 2025 Season 2
Sohaib Cheema 250 User Group Leader