Workflow Condition in Dynamics NAV 2016

catitienei
Member Posts: 5
Hello,
How can I do an approval workflow with a complex condition (could be a function from a codeunit)?
Thank You!
How can I do an approval workflow with a complex condition (could be a function from a codeunit)?
Thank You!
0
Best Answer
-
So just to make sure I understand correctly, you want to be able to check for all these conditions at the same time (as opposed to a "workflow" of these approvals in a specific order)?
It's worth noting workflow will only pick the first response that it finds with the matching conditions; so it will not execute all the workflows that match the criteria.
You could try to create a response such that once completing the first workflow, you fire another "approval request" that would be picked up by one of the other workflows. I'm not sure but you might then also need to create a fifth workflow that would then finally auto-approve the request when there are no remaining approval conditions as I would guess none of the other workflows will be triggered in that case.
So the thinking is:
Workflow 1 - on request for approval with condition customer credit limit exceeded
- request for approval from relevant approver
- resubmit for approval
Workflow 2 - on request for approval with condition customer is blocked
- request for approval from relevant approver
- resubmit for approval
Workflow 3 - on request for approval with condition item from Sales Line has an available quantity
- request for approval from relevant approver
- resubmit for approval
Workflow 4 - on request for approval with condition sales price is changed
- request for approval from relevant approver
- resubmit for approval
Workflow 5 - on request for approval with condition previous conditions are fine
- approve
Alternatively you could combine everything in one workflow with multiple branches but that would end up with 4^4 combinations
Hope this is helpful!Thanks, Sam.
Microsoft Dynamics NAV | App Service Engineer | Comments are my own5
Answers
-
Maybe you could create an event that does the condition?Thanks, Sam.
Microsoft Dynamics NAV | App Service Engineer | Comments are my own0 -
Yes, I tried, but I have the following business case which I didn't succeed to implement with workflows:
Sales Order needs approvals from different users depending on following conditions:
- Customer Credit Limit is exceeded (exist a workflow template for this) (Approval request from Sales Director)
- Customer is blocked (Approval request from Sales Director Assistant)
- Item from Sales Line has an available quantity under a value setup on Location (Approval Request from Inventory Manager)
- Sales Price is changed in Sales Line. (Approval Request from Product Manager)
How can I setup different workflows to send approval request to a Workflow User Group depending on conditions described above?
I think I have to request approvals also for Sales Order Lines (for Inventory Level and Sales Price), how can I do this?0 -
Sadly workflow doesn't really support 'or' conditions like this. You could get around this by creating 4 workflows with a custom event to handle the relevant approval loops.Thanks, Sam.
Microsoft Dynamics NAV | App Service Engineer | Comments are my own0 -
I've tried with two workflows, one on Customer credit limit (standard workflow template) and second one with a custom event on Sales Header (All most the same as Customer credit limit but on Customer Blocked this time).
The main event of both workflows is "Approval of a sales document is requested" (with an additional filter on Sell-to Customer No <> '' in order to enable both workflows).
And here I have the following steps:
1. First workflow send the approval request if the credit limit is exceeded. If the approval request is approved then the Order is released.
2. First workflow release the Order if the credit limit is not exceeded.
In both cases the second workflow is never triggered.
Any ideea how to link the workflows, or how to trigger more than one on the same event to check different conditions?0 -
So just to make sure I understand correctly, you want to be able to check for all these conditions at the same time (as opposed to a "workflow" of these approvals in a specific order)?
It's worth noting workflow will only pick the first response that it finds with the matching conditions; so it will not execute all the workflows that match the criteria.
You could try to create a response such that once completing the first workflow, you fire another "approval request" that would be picked up by one of the other workflows. I'm not sure but you might then also need to create a fifth workflow that would then finally auto-approve the request when there are no remaining approval conditions as I would guess none of the other workflows will be triggered in that case.
So the thinking is:
Workflow 1 - on request for approval with condition customer credit limit exceeded
- request for approval from relevant approver
- resubmit for approval
Workflow 2 - on request for approval with condition customer is blocked
- request for approval from relevant approver
- resubmit for approval
Workflow 3 - on request for approval with condition item from Sales Line has an available quantity
- request for approval from relevant approver
- resubmit for approval
Workflow 4 - on request for approval with condition sales price is changed
- request for approval from relevant approver
- resubmit for approval
Workflow 5 - on request for approval with condition previous conditions are fine
- approve
Alternatively you could combine everything in one workflow with multiple branches but that would end up with 4^4 combinations
Hope this is helpful!Thanks, Sam.
Microsoft Dynamics NAV | App Service Engineer | Comments are my own5 -
Hi Catitienei, have you managed to source a solution to this worklfow scenario? I have the same challenge and looking for possible standard NAV solution or will there have to be dev done?
Thanks0 -
Hi,
I didn't succeed to manage this with standard functionality. I did some development as I remember.1 -
Hi
On credit Limit Approval, is it possible to set approval based on credit limit Exceeds? Like if Credit Limits exceeds by 1000 then go to XX approver, if it is more than 5000 then go to ZZZ approver.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions