Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

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

Posted on by 140

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.!

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,832 Super User 2024 Season 1 on at
    RE: Need Submit workflow at a time for multiple Project budget in D365fo

    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.

  • Sam D. Profile Picture
    Sam D. 140 on at
    RE: Need Submit workflow at a time for multiple Project budget in D365fo

    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.

  • Sam D. Profile Picture
    Sam D. 140 on at
    RE: Need Submit workflow at a time for multiple Project budget in D365fo

    Okay ,

    Thank you for the confirmation

    Thanks Girish . It helps me

    Sam D.

  • Verified answer
    GirishS Profile Picture
    GirishS 27,832 Super User 2024 Season 1 on at
    RE: Need Submit workflow at a time for multiple Project budget in D365fo

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

    Thanks,

    Girish S.

  • Sam D. Profile Picture
    Sam D. 140 on at
    RE: Need Submit workflow at a time for multiple Project budget in D365fo

    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
    GirishS 27,832 Super User 2024 Season 1 on at
    RE: Need Submit workflow at a time for multiple Project budget in D365fo

    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.

  • GirishS Profile Picture
    GirishS 27,832 Super User 2024 Season 1 on at
    RE: Need Submit workflow at a time for multiple Project budget in D365fo

    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,

  • Sam D. Profile Picture
    Sam D. 140 on at
    RE: Need Submit workflow at a time for multiple Project budget in D365fo

    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.

  • Verified answer
    GirishS Profile Picture
    GirishS 27,832 Super User 2024 Season 1 on at
    RE: Need Submit workflow at a time for multiple Project budget in D365fo

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans