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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Need Submit workflow at a time for multiple Project budget in D365fo

(0) ShareShare
ReportReport
Posted on by 152

Hi 

I need a suggestion for a task.
When we create Project budget for projectId , after creation the cost details , the workflow option show , then we go to click on "Submit"

Path : Project Management & Accounting --> All Projects --> select Project --> Go to tab Plan --> under Budget Pane --> Project Budget --> click 

Proj_budget_I

After click on Project Budget Open a form , where we need to create Line for Costs , when we create Costs , The WorkFlow button will be enable for Submit the workflow.

Proj_budget_IIProj_budget_III

After Click on Submit , It submit the workflow and send it to Approver for Approve.

Now what I have to do ,
I want to know what should I do , that I can able to Submit Workflow at one time for multiple Project Budget , because for user it is going to more difficult to submit one by one because of more records.

So please suggest me what should I do for Submit the workflow for multiple Project Budget, It is requirement.

Please help me for this condition.!

  • Verified answer
    GirishS Profile Picture
    27,845 Moderator on at

    Hi Sam D,

    You can create one button on the form and on the button clicked method you can loop through all the record and submit each line to workflows.

    Refer to the below blog for submitting workflow via code.

    http://daxingwitheshant.blogspot.com/2019/10/how-to-trigger-workflow-and-update.html

    Thanks,

    Girish S.

  • Sam D. Profile Picture
    152 on at

    Hi Girish S.

    Thank you for giving me the idea to start the query.
    The standard workflow work on ProjBudget Form , so can you help me that how we can the projbudget cost line , because I extend the method execute of DataSource , but that method didn't brings the bulk projbudget .
    can you please suggest me that which methods I need to extend on loop .

    Sam D.

  • GirishS Profile Picture
    27,845 Moderator on at

    I am not able to get your question.

    You need to create a button and on that button clicked method get all the ProjBudgetLine against ProjBudget.

    Sorry to say that I am not well versed with this functionality. I am just giving you a suggestion.

    Thanks,

    Girish S,

  • Verified answer
    GirishS Profile Picture
    27,845 Moderator on at

    I found that you need to loop ProjBudget table and pass the RecId of that table to the workflow.

    Like below.

    ProjBudget projBudget;
    
    while select * from projBudget
        where projBudget.BudgetWorkflowStatus == projBudgetWorkflowStatus::Submitted
    {
        //submitting to workflow
        Workflow::activateFromWorkflowType( workFlowTypeStr(ProjBudgetOrig),
            projBudget.RecId,
            "Mass submission of workflow",
            false,
            curUserid());
               
            //Update the workflow status to Submitted on the table.
            ProjBudget::updateProjBudgetStatus(projBudget.RecId, projBudgetWorkflowStatus::Submitted);
    }

    Thanks,

    Girish S.

  • Sam D. Profile Picture
    152 on at

    Hi Girish ,
    Yes this code helped me , but I have a confusion , workflow submit for header or Line table . Can I use this code snip for ProjBudgetLine Table ?

    ProjBudgetLine projBudgetLine;
    
    try
    {
        //submitting to workflow
        Workflow::activateFromWorkflowType( workFlowTypeStr(ProjBudgetOrig),
            projBudgetLine.RecId,
            "Mass submission of workflow",
            false,
            curUserid());
               
            //Update the workflow status to Submitted on the table.
            ProjBudget::updateProjBudgetStatus(projBudgetLine.RecId, projBudgetWorkflowStatus::Submitted);
    }
      catch (exception::Error)
        {
        throw Error ("Not Submitted")
        }
    
    }

    but for line table I didn't get updateWorkFlowStatus method , so how can we do it ?

    Thanks 

    Sam D.

  • Verified answer
    GirishS Profile Picture
    27,845 Moderator on at

    I think there is no workflow for ProjBudgetLine table. Workflow will be for ProjBudget table only.

    Thanks,

    Girish S.

  • Sam D. Profile Picture
    152 on at

    Okay ,

    Thank you for the confirmation

    Thanks Girish . It helps me

    Sam D.

  • Sam D. Profile Picture
    152 on at

    Hi Girish,

    I have a query that,

    for this workflow submission , I have to created a Data Entity that user can check through excel instead of checking one by one

    so I created Data Entity of ProjBudget Table ,

    But the requirement is , there is need of validation , if from the batch job any budgetId has not been submitted , how we can get to know in excel of Data Entity ?

    Can you please suggest me the way that should I add a custom field on Data Entity or any thing else I need

    Please suggest me a solution and if any query let me know !

    Thanks

    Sam D.

  • Suggested answer
    GirishS Profile Picture
    27,845 Moderator on at

    There will be one Enum field in the table which holds the status of the workflow. If that field is Not Submitted than you can identify that the workflow is not submitted.

    Thanks,

    Girish S.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 213

#3
Subra Profile Picture

Subra 200 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans