Tag Archives: Purchase Order
Factbox of workflow history on purchase order in D365FO
Introduction: In this blog, we will see how to create factbox of workflow history of purchase order in Microsoft Dynamics 365 Finance and Operations Details: Well, Factbox is a very pretty cool feature available from the earlier version AX 2012. It is very easy to achieve in Dynamics 365 as well. Here we will see how easy it is and steps for that. As shown in the above image, we will be going to create factbox for the “Tracking details list” Steps: Create the solution in Visual Studio and project for that. We’ll be required four objects mainly that is one display MenuItem, Table, Form (on which to display factbox), another Form (factbox). Reference attached below: 1. Table For displaying workflow history, we need to create the extension of table WorkflowTrackingStatusTable and create the normal relation and its relevant properties as 2. Factbox Now we are required to create the factbox of workflow history. For that we will use the effortless technique, where we will duplicate the standard form “WorkflowStatus” and will name as CFSPurchTableWorkflowHistoryFactBox (give name as per your naming convention standards) After duplicating and renaming the form, we need to change the pattern as “custom” After applying the custom pattern, delete the NavigationList which is not required in factbox, and do visible false ActionPane and PanelTab After that create the new Grid and assign the data source to it in the property and put all the required fields to show in factbox 3. Display MenuItem We will attach the created factbox form to the display menu item and relevant label “Workflow history” 4. Base form Base form we call it as where we will attach the factbox. Here it is purchase form. Go to Parm section and create a new part and give it a relevant name and its properties Properties: Data source: Attached data source with which workflow history is connected Data Source Relation: WorkflowTable.RelationName Name: Part name That’s it. Build the project and go the frontend and check the output how it looks like. Conclusion: It results as (we can scroll left and right to see all the tracking details list) Hurray, How pretty it looks like! In the above example, we have seen how we can develop factbox in Microsoft Dynamics 365 Finance and Operations. Thanks for reading and stay connected with us for more updates!!! Jagdish Solanki | Senior Technical Consultant | CloudFronts Business Empowering Solutions Team “Solving Complex Business Challenges with Microsoft Dynamics 365 & Power Platform”
Change RFQ purchase order status as draft insted of default approved
When we create purchase order using RFQ its default approval status will be approved. To change that status to draft write following code where we will change its status to draft. create new class and add following code class CFSPOStatusRfq { [PostHandlerFor(classStr(PurchAutoCreate_RFQ), methodStr(PurchAutoCreate_RFQ, endUpdate))] public static void PurchAutoCreate_PurchReq_Post_endUpdate(XppPrePostArgs args) { //PurchTable purchTable = args.getThis(‘purchTable’); PurchAutoCreate_RFQ purchReq = args.getThis() as PurchAutoCreate_RFQ; PurchTable purchTable, purchTablenew; purchTable = purchReq.parmPurchTable(); ttsbegin; select forupdate purchTablenew where purchTableNew.PurchId == purchTable.PurchId; if(purchTablenew && purchTablenew.DocumentState == VersioningDocumentState::Approved) { purchTablenew.DocumentState = VersioningDocumentState::Draft; purchTablenew.update(); } ttscommit; } }
Customize Purchase order approval status
In the case of D365 Finance and Operations when you approve purchase requisition by default system creates Purchase order with approval status as “Approved” as follows To change this default behavior of system such that once purchase requisition is approved the approval status of the purchase order as a draft you can use the following class class CFSPOStatus { /// <summary> /// /// </summary> /// <param name=”args”></param> [PostHandlerFor(classStr(PurchAutoCreate_PurchReq), methodStr(PurchAutoCreate_PurchReq, endUpdate))] public static void PurchAutoCreate_PurchReq_Post_endUpdate(XppPrePostArgs args) { //PurchTable purchTable = args.getThis(‘purchTable’); PurchAutoCreate_PurchReq purchReq = args.getThis() as PurchAutoCreate_PurchReq; PurchTable purchTable, purchTablenew; purchTable = purchReq.parmPurchTable(); ttsbegin; select forupdate purchTablenew where purchTableNew.PurchId == purchTable.PurchId; if(purchTablenew && purchTablenew.DocumentState == VersioningDocumentState::Approved) { purchTablenew.DocumentState = VersioningDocumentState::Draft; purchTablenew.update(); } ttscommit; } }and your final result looks like And after changing status you can apply your own purchase order workflow on it. For purchase order workflow you can refer to my blog
How to create and apply workflow for purchase order in D365 finance and operations
In this blog we will learn how to create workflows in D365 finance and operation. For this blog we are taking example of Purchase order workflow. Which will allow us to create purchase order which is allocated to different persons for approval and review process. Navigate to Procurement and Sourcing >>Setup>>Procurement and Sourcing workflows, and click on new and select purchase order workflow as follows:- This will open workflow editor in you first need to provide log in details same as that of environment. Here we need to arrange various components and need to set their properties to resolve those following errors. Components for this of workflow: – Start: – To indicate start of workflow design. End:- To indicate end of workflow design. Review Purchase order:-This assign review(Complete/Return PO). Approve Purchase order:- This assign users who needs to approve purchase order. To design workflow follow the steps :- Now In designer create design as shown in screenshot Set the Review element and right click and open properties and set as basic settings as follows:- In assignment make sure you have assigned type(in our case user) and user name You can also escalate roles after certain time as follows(we are not considering this setup for this blog) Now get back to approve purchase order and open its properties for and set automatic action as follows which will approve Purchase order below 10000 USD. Set the notification for person who will receive notification when particular operation is performed(for eg :- Approved/rejected etc) Now click on step 1 to enter in step 1 section and open its properties. First we are assigning user who will approve the purchase order as screenshot suggest as well as you can set time limit for approval and completion policy as well. You can also add the condition to step 1 which will decide whether to run this step or notNow close step and get back to main design of designer Now click on save and close and mention version notes and activate this workflow Now you can see new workflow in procurement and sourcing workflows Now create new purchase order and after that click on workflow button and click on submit you can also check history of it Now another user will complete the purchase order approval and mention comment. Now user with authority of approval will approve from common>>Work Items assigned to me
Purchase Order Workflow formatter error in D365 Finance and Operations
Introduction: In D365 Operations, when we create a workflow for Purchase Order we face a formatter error related to Time zone. This error is caused due to conflict as same time zone specified twice for a legal entity. First for the legal entity and second time for the address. In this blog, I will tell you how to resolve it. Solution: Go to Organization Administration -> Legal Entities In Address Tab, select More options -> Advanced In General Tab, Edit the Time zone to a different time zone.