Category Archives: Blog
Explore Business Central API through Postman using Basic Authentication
Introduction: In this article, we will walk through steps on how to authenticate Business Central API using Basic Authentication in Postman Pre-Requisite: Business Central account Business Central API Basic authentication in Postman: In Postman, make a GET request to Business Central base API URL. Base URL: https://api.businesscentral.dynamics.com/v1.0/api/beta For using Basic Authentication, we need to add domain as well. Domain URL: https://api.businesscentral.dynamics.com/v1.0/myusersdomain.com/api/beta In Business Central, generate Web Service Access Key for your user. Now in Postman authorization tab, select Basic Auth in Type. Provide Username and Web Service Access Key Click Send
Share Story :
Setup Positive Pay Export
Introduction: What is Positive Pay Export and Why it’s used? Positive Pay Export is a file that is given to the bank to verify the Cheques that have been printed. Whenever the company wants to issue any payment to Customer or a Vendor, it is done with the help of Payment Journals. After creation of Payment Journal lines, the check is printed through a Report. After the creation of the Check in the Bank Account there is an action called as PositivePayExport. This file is a text file and contains the information related to the Cheques printed and it is given to the bank. Every bank has their format which is used to automatically verify the Cheques that are being issued. Pre-requisites: Microsoft Dynamics NAV 2017 Demonstration: 1. Creating a Bank Account: To issue the cheque setting up Bank Account is mandatory. 2. Setting up the Data Exchange Definitions: Data Exchange Definition is used to set up the format for Positive Pay Export. The format for Export: Create a new Data Exchange Definition: Creating Column Definitions: Column Definition is the sequence in which the data is to be generated as per the format. Creating a Line Definitions: Line Definitions are used to map the System Fields to the fields in the column definitions. In the Line Definition, there are transformation rules that are used to modify the data that is exported into the format. Create a Line Definition and Select Field Mapping. There are some predefined Transformation Rules as well as new transformation Rules can be created. I’ve created the following transformation rules. I’ve shown the details of REPLACE transformation rule 3. Connecting the Data Exchange Definition with the Bank Account: To link the Positive Pay Export and the Bank Account, go to Bank Accounts and select the Positive Pay Export Code. 4. Creating Payment Journal Entries, Printing Cheques and Exporting the Positive Pay file. Creating Payment Journal Entry Printing the Check Report Positive Pay Export in Bank Account KEY4679 After Exporting Positive Pay Export the values generated in Positive Pay Export file are as follows. 000003296812746790000000012201805150000010200 000003296812746790000000013201805150000010512
Share Story :
Create Approval Flow with D365 conection
Introduction: This blog explains how to Create Approval Flow using Microsoft Flows. Use Case: When work order is updated. (Trigger) Check condition: system status: – open-completed and approved: -NO If condition satisfied: – Check Total amount: – If amount is greater than 1000 approval mail will be sent to approver. if he approves: update the work order with system status value closed-posted. else do nothing. update the work order with system status value closed-posted. Else do nothing. Steps to be followed: Sign in to the Microsoft flow. https://flow.microsoft.com/en-us/ Go to My flows –> create from blank Select Dynamics 365 when a record is updated Select the Organization Name and Entity Name for which you want to create flow. Click on + New step –> Add a condition. So here I want my flow should run when system status is open-completed and approved is NO. (Add your own conditions). Condition:@and(equals(triggerBody()?[‘msdyn_systemstatus’], 690970003),equals(triggerBody()?[‘cf_approved’], false) ) Go to Yes. Click on …More –> add a conditionCondition is: Total amount is greater than 1000. Go to yes. Add Action. Select Approvals –> Start an approval action. Enter details.In Assigned to enter the email address of the approval. Go to No. configure for amount is not greater than 1000. Click on Add an action. –> select Dynamics 365 – update a record. Enter the details. Enter the details Record identifier: Enter the record identifier of Work Order from when a record is updated step. Set the system status value to: 690970004 Add condition in Yes and check the approval status. On Yes. Select Add an action à Dynamics 365 – Update a record Enter the detailsRecord identifier: Enter the record identifier of Work Order from when a record is updated step.Set the system status value to: 690970004 Complete Flow:
Share Story :
Scheduling Project Tasks in Dynamics 365 PSA
Overview: Out-of-the-box, it is not possible to Book a task a on the Schedule Board, instead what you get at the easiest disposal is to allocate partitions of the Project to the resources and not the items from the WBS! Well, as a workaround, I’ve enabled the Project Task entity for Resource Scheduling using the PSA OOB feature to make this happen. Enabling Project Task Entity for Resource Scheduling: To be able to schedule a Project Task on the Schedule Board, we must first expose the entity itself for this capability. Here’s how you do it – Navigate to Resource Scheduling once you are using PSA and then select Administration. Then, select Enable Resource Scheduling for Entities Then, look carefully that the only entities enabled are the Project and Work Order (Field Service) Now, you want to add Project Task entity so that you can directly use Project Task to schedule on the Board. Make sure you make your selection as per below and click on Publish Customization Once Published, Project Task will appear in the Enabled Entities list Scheduling on the Project Task on Schedule Board: Assume you have some Project Tasks to Schedule, you can simply use those as you would do for Project and Work Order and you can schedule in the usual way thus, achieving Scheduling on Project Tasks from WBS instead of the Project.
Share Story :
How to Send Mail with attachment using Streams for reports with request page in Dynamics NAV
Scenario: On Customer Master page, an action button is created called Email customer, on click of the action button, an email has to be sent to the respective customer with attachment of the invoices in a .pdf format. Here, the report is saves as .pdf file. This report has a request page where Start Date and End date are entered by the user. Based on the date ranges, invoices generated for the particular user is mailed to the customer. Pre-requisites: Microsoft Dynamics NAV 2017 Steps: 1. Create a global function on the Customer master page to make a call to the codeunit. Here the Customer No. is passed as a parameter. 2. In the Function InvoiceMail, declare a parameter CustNo. and the variables as follows: Here CustTempTable is a Temporary table The Code is added as follows: InvoiceMail(Custno : Code[20]) -Function Name SMTPMailSetup.GET; CustomerTable.RESET; CustomerTable.SETRANGE(“No.”,Custno); IF CustomerTable.FINDFIRST THEN BEGIN EmailID:=CustomerTable.”E-Mail”; CF_FTLCustomerInvoice.SETTABLEVIEW(CustomerTable); XmlParameters:=CF_FTLCustomerInvoice.RUNREQUESTPAGE(); CustTempTable.Parameters.CREATEOUTSTREAM(OStream,TEXTENCODING::UTF8); CustTempTable.Parameters.CREATEINSTREAM(IStream,TEXTENCODING::UTF8); REPORT.SAVEAS(50011,XmlParameters,REPORTFORMAT::Pdf,OStream); CLEAR(SMTPMail); SMTPMail.CreateMessage(”,SMTPMailSetup.”User ID”,EmailID,’Invoice Statement from CompanyName‘,”,TRUE); SMTPMail.AddAttachmentStream(IStream,’Customer Invoice’+ CustomerTable.Name+’.pdf’); SMTPMail.AppendBody(‘Hi ‘+CustomerTable.Name+’,’); SMTPMail.AppendBody(‘<br>’); SMTPMail.AppendBody(‘Please find attached your Customer Invoice statement’); SMTPMail.AppendBody(‘<HR>’); SMTPMail.AppendBody(‘This is a system generated mail. Please do not reply to this mail!’); SMTPMail.Send; MESSAGE(‘Mail sent to Customer %1’,Custno); END; Explaination of the code: 1. Set the SMTL Mail setup in the Role Tailored Client. Click on Apply Office 365 Server Settings. Add the Sender email (comapny email in my case) in User ID field and password of the email id in the Password field. 2. Store the Customer Email in the Email ID variable. 3. Pass the filters applied to the CustomerTable to the report variable CF_FTLCustomerInvoice. 4. Run the request page. The Run request page passes the request parameters in an xml format which is stored in a text variable XmlParameters. 5. Create an OutStream to save the the XmlParamters received in a File Parameters in a .xml format. 6. Create Instream to read the .xml file. 7. REPORT.SAVEAS(50011,XmlParameters,REPORTFORMAT::Pdf,OStream); saves the xmlparameters from the outsream in an pdf format. 8. Use SMTPMail.CreateMessage function to enter the sender’s and receipient’s email, Subject etc. 9. Add the attachement from the InputStream. 10. Draft a body of the email and Use SMTPMail.Send to Send the email. Yay.Email is Sent! Execution: 1.Click on Action button, Request page opens. 2. Enter the Start date and End date and click on OK. 3. An email is sent to the customer. Conclusion: Overview of the blog, first setup the SMTL Mail setup. Create an action button and create a function call. In the function defination, code as above and email is sent
Share Story :
Explore Business Central API through Postman using AAD Authentication
Introduction: In this article, we will walk through steps on how to authenticate Business Central API using AAD Authentication in Postman Pre-Requisite: Business Central account Admin Access in Azure Portal Business Central API AAD authentication in Postman: In Postman, make a GET request to Business Central base API URL. Base URL: https://api.businesscentral.dynamics.com/v1.0/api/beta For using successful authentication, we need to add domain name or tenant ID Domain URL: https://api.businesscentral.dynamics.com/v1.0/myusersdomain.com/api/beta In Azure Active Directory, create a new Web API Type application registration. Sign On URL: https://www.getpostman.com/oauth2/callback Reply URL: https://www.getpostman.com/oauth2/callback Required Permission: Dynamics 365 (Note: If you are not able to find Dynamics 365 under the required permission, type Dynamics in Search bar on required permission section. Also, remember to Grant Permission to Application(requires Admin permission)) Under the Keys section, add new Key and Save. Copy the Generated Key as it will not be visible later. Now in Postman authorization tab, select OAuth 2.0 in Type. Provide following details Give a Token Name Call back URL: https://www.getpostman.com/oauth2/callback Auth URL: https://login.windows.net/myuserdomain.com/oauth2/authorize?resource=996def3d-b36c-4153-8607-a6fd3c01b89f Access Token URL: https://login.windows.net/myuserdomain.com/oauth2/token?resource=996def3d-b36c-4153-8607-a6fd3c01b89f Client ID: (Application ID of Azure Application) Client Secret Key: Paste the Key copied in step 2.d Grant Type: Authorization Code Untick Request Token locally Click Request Token and then Use Token. If the token is successfully generated, then you will see Authorization Code under Header section in Postman Now Click send.
Share Story :
Voice of the Customer – Resolved Issues
Introduction: Voice of the Customer features creating and sending out surveys to gain valuable feedback from your customers about your products or services. Respondents can take your surveys on a phone, tablet, or computer. You can see your customer’s feedback history as you work a sale or resolve a service case. In this blog we will have look on the solved issues by Microsoft till now. Resolved issues in Voice of Customer version 9.0.1162: The survey minimum and maximum values revert to their default values on saving the question. Invitation Link Text field gives HTML Validation Error when you provide input like <<<Hello>>>. The mandatory date question response validation fails for locales with dd/mm/yy date format in Google Chrome. Multiple survey responses are created when you open a survey link in different tabs or browsers and submit. Rotation of headers in Single rating in columns and Multiple ratings in columns questions do not work. In French locale, a few emoticons are not displayed while previewing the Smilies rating question. You were unable to preview or publish a survey if “>>>” or “<<<” characters are in the Invitation Link Text field. Resolved issues in Voice of Customer version 9.0.1113.10: Footer URLs are opened in the same tab as survey. Unable to enter negative value as the answer to the numerical response question. All answer options of a mandatory question are highlighted if an option is not selected by the respondent. The Response column under the Question Responses section in a survey response allows only 100 characters. Resolved issues in Voice of Customer version 9.0.959.8: Feedback entity does not work properly on all locales specified in Dynamics 365. Unable to clone surveys on a French organization. The default count resets to five in a start-rating question even after modification. The unsubscribe link is not visible on the survey. Respondent can skip Single Rating question even though it is marked as mandatory. Translation corrections for few strings in the Japanese language. The error messages are not appropriate in case of a survey exception. The social sharing dialog box is not displayed completely on the survey. You can refer our previous blogs on Voice of Customer for proper understanding of Voice of Customer solution.
Share Story :
Download Doucument Templates using Console App
Dynamic 365 development services has a team of experts, D365 architects and developers who works closely in every step in the business while closely understanding the requirements and designing the right solution for the business according to the needs as far as development is concerned the development team has a set of experts and developers that coordinate closely with the client and by using standard microsoft development technologies like visual studio and TFS online a robust and concrete development process is strategised. After developing the application it is internally tested according to the business needs and submitted to microsoft in order to clarify any issues. After that the application is listed on the App Source. Introduction: In this blog we will be demonstrate how to download word document templates from D365 Customer Engagement and then import them to another environment. Often there are requirements to move document templates from one environment to another. But currently adding document templates to solutions is not supported. To overcome this we have created a console app which downloads the word document template. Implementation: Step 1: To download Document templates we have created a Console App and it requires the following details: Username Password Organization Service Endpoint Address GUID of the template word template to download The username and password are the basic details that we use to log in to https//:www.portal.office.com To get the Organization Service Endpoint Address, navigate to Settings > Customizations > Developer Resources and copy the address as shown in the image below. To get the GUID of the Template Navigate to Settings > Templates > Document templates and open the template you want to download and Click on the Pop Out option at the top right as shown below Then from the URL we can get the GUID of the record as shown Step 2: The code to download the document template is shown below. It downloads the Word template and stores it in the location specified in the code. Remember to change this location to the location on your PC. Note: Replace all the required values in the code according to your organization details. Code: using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Client; using System; using System.Net; using System.ServiceModel.Description; using System.Text; using Microsoft.Crm.Sdk.Messages; using Microsoft.Xrm.Sdk.Query; using System.IO; namespace DownloadDocumentTemplates { public class DocumentTemplateDownload { static IOrganizationService _service = null; static OrganizationServiceProxy _proxy = null; static void Main(string[] args) { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; ConnectToCRM(“test@test.onmicrosoft.com”, “pass@1234”, “https://test.api.crm8.dynamics.com/XRMServices/2011/Organization.svc”); Guid userId = ((WhoAmIResponse)_service.Execute(new WhoAmIRequest())).UserId; if (userId != null) { Console.WriteLine(“Guid: ” + userId); //GUID of the document template String documentTemplateId = “094EEB2A-948C-E711-8112-70106FAA45E1”; GetDocumentTemplateContent(documentTemplateId); Console.ReadKey(); } } public static void ConnectToCRM(string _username, string _Password, string _OrgSOAPServiceUri) { try { ClientCredentials credentials = new ClientCredentials(); credentials.UserName.UserName = _username; credentials.UserName.Password = _Password; Uri serviceUri = new Uri(_OrgSOAPServiceUri); _proxy = new OrganizationServiceProxy(serviceUri, null, credentials, null); _proxy.EnableProxyTypes(); _service = (IOrganizationService)_proxy; } catch (Exception e) { Console.WriteLine(“Error while Connecting: ” + e.Message); } } public static void GetDocumentTemplateContent(string documentTemplateId) { EntityCollection doc = null; string content = null; string documentTemplateName = string.Empty; Encoding encoding = Encoding.UTF8; try { string fetchXML = @”<fetch version=’1.0′ output-format=’xml-platform’ mapping=’logical’ distinct=’false’> <entity name=’documenttemplate’> <attribute name=’content’ /> <attribute name=’documenttype’ /> <attribute name=’name’ /> <attribute name=’status’ /> <attribute name=’modifiedon’ /> <attribute name=’modifiedby’ /> <attribute name=’description’ /> <attribute name=’languagecode’ /> <attribute name=’associatedentitytypecode’ /> <order attribute=’documenttype’ descending=’false’ /> <order attribute=’name’ descending=’false’ /> <filter type=’and’> <condition attribute=’documenttemplateid’ operator=’eq’ uitype=’documenttemplate’ value='” + documentTemplateId + @”‘ /> </filter > </entity > </fetch > “; doc = _service.RetrieveMultiple(new FetchExpression(fetchXML)); if (doc != null) { if (doc.Entities.Count > 0) { content = doc[0].Attributes[“content”].ToString(); documentTemplateName = doc[0].Attributes[“name”].ToString(); } byte[] textAsBytes = Convert.FromBase64String(content); File.WriteAllBytes(@”C:\Users\test\Desktop\” + documentTemplateName + “.docx”, textAsBytes); } } catch (Exception) { throw; } } } } Step 3: When the code is run it downloads the document template on the your PC and the document template is named after the template in CRM. Conclusion: This is very helpful as it can be used in another environment by simply uploading the template. To import the word template we can navigate to Settings > Templates >Document Templates and then upload the template.
Share Story :
User based Personalized Workspace from UI in D365 Operations
Introduction: In D365 Finance and Operations, there are various modules and each contains many forms. Users working in Operations uses forms from different modules and sometimes it becomes difficult to navigate or remember the path of all forms. It is also time consuming. A good solution for this is creating a Personalized Workspace and adding all the required items in it. Everyone know this can be done from code using forms. Another simple way is to create a Workspace directly from UI and it will be only available to the user who created it. In this blog, I will show you how to create workspace specific to users from UI. Steps: Create Workspace Rename Workspace Add elements to workspace Create Workspace: Go to D365 Operations Default Dashboard page. Right click anywhere on the Dashboard -> Select Personalize In the Dialog Select an option ‘Add a workspace’. This will add a new Workspace at the end of page Rename Workspace: Right Click the Workspace -> Click Personalize: My Workspace 1 Enter a Name in the textbox Add elements to workspace: Go to form you frequently use to add on Workspace. In this case I will add All customers to my workspace. Accounts Receivable -> Customers -> All Customers In Action Pane, go to Options Tab -> Personalize, select Add to Workspace. In Workspace dropdown, add name of newly created workspace. In Presentation dropdown, select the format in which you want to display the form Tiles- It is a summary view. List- It is a Tabbed format. It can be horizontal or vertical. Link- It will simply display a link taking you to the form. Conclusion: This is how we can create a personalized workspace which will be limited to respective user. We can also personalize the workspace using controls residing in personalize option.I will provide more details on this in my next blog.
Share Story :
Booking resource on a Project Task or a Service Ticket in PSA
Successful and on time delivery of the project is the heart of the business for any professional services organization. Where services based projects are delivered. In order to ensure successful project delivery efficient tools and industries based practises needs to be implemented which is possible through Microsoft Dynamics 365 Project Service Automation. Project service automation is not very easy and not something that anyone can do. By using services automation project managers have been able to deliver projects of various sizes. For industries best practices and efficient project management the set up of PSA is very much required. Apart from the above aspects, project service automation also helps to manage time and budget of the billable projects as well as estimate the quote for the project. Introduction: PSA doesn’t have the capability OOB to do the allocation’s over the task. This means the resource booked are booked for a project and we cannot identify what task they are going to perform or are booked for. How to do? This is the real time scenario which a PM regularly comes up with while allocating. To this I have figured out a solution that can be worked upon. Write a Plugin to create a Resource Requirement record on creation of Project Task in the WBS. In schedule board expose Project task Entity to be visible. This will allow you to drag and drop the allocations on to the schedule board. But, the challenge here is that the Project Tasks doesn’t comes automatically in the above grid. It comes because of the Plugin written above to create a record of Resource Requirement. Ensure the plugin will take care of the updates made to the task and will update the Resource Requirement record simultaneously. In our organisation we also, allocate resource on cases that the clients have raised. For the same, we will have to write a workflow to create a task in WBS as soon as a case is created. On the creation of a task we already have a plugin written to create a Resource Requirement record. You can then allocate Resources on cases.