Create SharePoint Folder using POST request in MS Flows
Introduction: This blog explains how to create folders in SharePoint when new record is created in D365 CE. Use Case: When new account is created in D365 CE create “Contact Documents” and “Documents” folders in SharePoint. Pre-Requisites: D365 CE SharePoint Online Microsoft Flow Steps to be followed: Sign in to the Microsoft flow. https://flow.microsoft.com/en-us/ Go to My flows -> “+New”-> “+Automated-from blank” 3. Select “When a record is created” trigger and click on create. 4. Select “Organization Name” and “Entity Name”. 5. Click on “+New Step” and select “Compose” Action. 6. a. Add “Account Name” from Dynamics Content in Input. b. Add underscore “_” c. Click on Expression enter below formula: toUpper(replace(triggerBody()?[‘accountid’],’-‘,”)) d. Compose should look like below: 7. Now we will create “Main folder in SharePoint” for this account. 8. Click on “+New step” and select “Send an HTTP request to SharePoint” Action. 9. Enter below details: Site Address: Select the site address from the list. Method: POST Uri: _api/Web/GetFolderByServerRelativeUrl(‘account/Output of Compose‘)/Folders Headers: Content-Type application/json;odata=verbose Accept application/json;odata=verbose Body: { ‘__metadata’: { ‘type’: ‘SP.Folder’ }, ‘ServerRelativeUrl’:’account/ Output of Compose‘} 10. Now we will create sub folders inside the main folder. 11. Click on “+New step” and select “Send an HTTP request to SharePoint” Action. 12. Enter below details: Site Address: Select the site address from the list. Method: POST Uri: _api/Web/GetFolderByServerRelativeUrl(‘account/Output of Compose/Contact Documents‘)/Folders Headers: Content-Type application/json;odata=verbose Accept application/json;odata=verbose Body: { ‘__metadata’: { ‘type’: ‘SP.Folder’ }, ‘ServerRelativeUrl’:’account/ Output of Compose/Contact Documents‘} NOTE: “Contact Documents” is the sub folder which we want to create in main folder. 13. Repeat “step no 12” to create “Documents” folders. Uri: _api/Web/GetFolderByServerRelativeUrl(‘account/Output of Compose/ Documents‘)/Folders Body: { ‘__metadata’: { ‘type’: ‘SP.Folder’ }, ‘ServerRelativeUrl’:’account/ Output of Compose/ Documents‘} NOTE: “Documents” is the sub folder which we want to create in main folder. Complete Flow: Testing Flow Create new account record in D365 CE. Check Documents in SharePoint.
Share Story :
Add Dynamics 365 Lookup functionality in HTML Web resource
Introduction In this blog we will look at how we can add the lookup functionality of dynamics 365 Customer Engagement in our HTML web resource. Implementation Step 1 : We have already added a web resource in our app, you can refer to my blog on “ADD HTML page in Dynamics 365 Customer Engagement Apps”. Below is the screenshot of how it looks like Step 2: Here we have a project field, and every time the Project button is clicked the select Project form opens up as shown in the below image. Please note that the Project entity we are using is a custom entity and not the Out of Box project entity Step 3 : When the Project is selected from this and the Add option is clicked, the name of the project will be shown in the “Select Project” field on the HTML web resource. Step 4: The HTML code for this is here. In the HTML code there is a reference to an external JavaScript file which handles the logic to open the lookup tab and set the name of selected project as seen previously. You can find the JavaScript code here Note: In the referenced HTML code, for the Layout button we have added an “on Click” event which is not present in the referenced JavaScript code. So while using the referenced code, please make sure you remove that reference from the HTML or add another function that you would like to call. Below shown in the code snippet that needs to be modified <input class=”form-control” id=”selectedProjectRelatedLayout” type=”text” placeholder=”Select Layout” readonly=””> 2. In HTML file we have also added the reference to a JavaScript file which we have added as a JavaScript web resource in Dynamics 365 CE. You will need to modify this reference based on the web resource structure in Dynamics 365 CE. <!– Below mentioned are the CRM Reference files based on the hierarchy of Webresources created, the bottom two references will change according to your folder structure for Webresources in CRM–> <script src=”../../../../ClientGlobalContext.js.aspx” type=”text/javascript”></script> <script src=”../BusinessLayer/SafetyInspectionCustomization.js” type=”text/javascript”></script> Hope this helped!
Share Story :
Error during CPOS/MPOS activation for Microsoft Dynamics 365 for Retail
In this blog I am going to show you how to fix an error you get during CPOS/MPOS activation. At times you may get following error : Validation: Failed, Messages: <“Channel has not been published.”> Solution: Step 1 Go to Channel categories and product attributes. Select your store and in Category hierarchy select channel navigation hierarchy Step 2 Then click on publish channel updates Step 3 Now go back to your device and click on “Validate Devices for Activation.” You should not get the error message anymore. Hope this works!
Share Story :
OCR service Setup and process in Microsoft Dynamics 365 Business Central
Introduction to OCR: OCR (Optical Character Recognition) is used to automate the data entry process for vendor invoices When a purchase invoice is received from the vendor, the client stores the invoice either in a file or manually does the entries in excel sheet With the use of Microsoft Dynamics 365 Business Central, invoices can be stored on cloud in the system OCR service setup: OCR service setup needs to be done in order to process the automation which is done through Kofax, which is a process automation software provider. The client should register to avail the following functions at the given price: Trial Basic Premium Documents 75 100 100 Validity(months) 2 1 1 Price (USD) Free $60 $105 Price per extra Invoice No extra invoice after 75 $0.56 $1.12 Specifications: Yes Yes Yes · Online correction · Header/Footer capture Yes Yes Yes · Line item capture Yes No Yes To avail this service the user needs to get registered under Kofax. (www.kofax.com) Registration process includes providing details such as: name, email, mobile no, Company name, address and so on. Fig 1. Kofax sign up page Once the registration is complete Kofax sends an authorization key to the user on his mentioned email. Fig 2. Registration mail from Kofax The key is later used to send the invoices to the service provider to scan the invoice and receive it back. (without the authorization key, OCR process cannot be completed) Fig 3. OCR service setup OCR process: For mail received invoice save the pdf invoice in the computer and for printed copy of invoice click a picture of the invoice which should be a clear and visible picture. Go to incoming documents in Microsoft Dynamics 365 Business Central. Click My incoming documents Fig 4. Click on new and then create from file Fig 5. Creating Invoice from File This will ask to choose a file from your computer Choose the file pdf saved earlier in the computer Check all the details of the vendor invoice Click on OCR and then send to OCR service Fig 6. Sending the document to OCR service Click on receive from OCR service Fig 7. Receiving the document from OCR service The details on the invoice will be entered as per the heads in the document Check all the financial details as per the invoice to verify Fig 8. Checking the financial information Click create document and the document will get stored in the system Fig 9. Creating the document as purchase invoice Check for errors and warnings in the document Fig 10. Checking for errors and warnings To correct the error, click on OCR and under that correct the OCR Fig 11. Option to correct the OCR Correct the mistakes and select “Send OCR Feedback” to send the corrections to the OCR service, so that the mistakes will not repeat You can check the document in the purchase invoice Open the created document Enter the vendor invoice number for reference which will be star marked Now post the document with an option to print the document as well Fig 12. Final posting of the purchase invoice Check for the document in the posted purchase invoice by searching for the vendor invoice number.
Share Story :
Environment Setup for PSA to F&O integration with CDS
Today, I will show you the Environment Setup for PSA to F&O integration with CDS. Step 1: Create the environment Open the link https://admin.powerapps.com and click to create new environment Following pop-up window will appear and enter the details and click on Create Environment, so new environment will gets created The environment will get created Step 2: Create the connections To create the connection, open the link https://web.powerapps.com and go to the connection in newly created environment (In this case: DemoEnvironment) In the data section click on connections section and click on the “Create a connection” to create new connection Following screen will be visible, select the “Dynamics 365” connection. When clicked on the Dynamics 365 popup window will appear asking whether to create connection or not. Click on create and enter the credentials And finally source connection gets created Now create the Destination connection In the connections search for “Dynamics 365 for Fin & Ops”, when clicked it will ask whether to create connection or not click on create and then enter the credentials and finally connection will be created Once we created the Environment and connections now create Connection sets and create project Go to https://admin.powerapps.com and open the Data Integration tab. 2. Click on the connection set section and click on the “New Connection Set” following popup window will appear and click on Create Step3: Once Connection set gets created now let’s create the Project Go to project section and click new project and following form will be visible and enter the Integration project name and select the ready made template available or create custom integration project. In this case we are selecting ready made template for account and click on next. Select the connection set from the drop down select the connection set which we have created earlier: DemoConnectionSet and click on next Select organization and click next and finally click on create So now we have created accounts integration project Hope the above helps!
Share Story :
How to Add a Sales Representative/Associate in Microsoft Dynamics 365 for Retail
You may need to add a sales representative/associate while performing a transaction on POS. For this, you need to add the particular worker to sales group and set it up as below. In this blog, I will show you the process: Step 1 Go to Sales and marketing>Commissions>Sales groups Step 2 Click on General>Sales rep Step 3 In filter type the name of the Rep and select Step 4 Next run staff job from the distribution schedule and check in download sessions if the job is run. If it remains in the available state for more than few minutes then you may need to run a batch job manually from batch jobs by changing its date and time. Check again in download sessions. It should be in an applied state. Hope this works!
Share Story :
Microsoft Teams PowerShell Module Overview
Introduction: In this article, we are going to take a quick overview of the Microsoft Teams PowerShell module and will cover a few things which we can perform in Microsoft Teams with the help of PowerShell. There are two different PowerShell modules to manage Microsoft Teams. 1. Microsoft Teams PowerShell Module – You can get this module from here: https://www.powershellgallery.com/packages/MicrosoftTeams/1.0.0 2. Skype for Business PowerShell Module – You can download it from here: https://www.microsoft.com/en-us/download/details.aspx?id=39366 Teams PowerShell module contain all the cmdlets needed to create and manage teams whereas Skype for Business module contains the cmdlets to manage policies, configuration, and other tools. Connecting to Microsoft Teams PowerShell: 1. Install the Microsoft Teams PowerShell Module. Open Windows PowerShell and run the command “Install-Module -Name MicrosoftTeams” and then enter Y. Module was already installed on my system, that’s why I got the messages highlighted in the above image. The version was old, so I re-entered the command and added the -Force parameter “Install-Module -Name MicrosoftTeams -Force” 2. Connect with Microsoft Teams. Run command “Connect-MicrosoftTeams” and enter the credentials. After login, you will be able to see your tenant details. 3. After the PowerShell Module relates to your Microsoft Teams, you can use the cmdlets for creating and managing teams. For e.g, To get all your teams list, run command “Get-Team” For creating a new team, run command “New-Team” For managing Team users, run command “Add-TeamUser”. You will be asked to provide GroupId. After providing the GroupId, it will ask to provide the user, which needs to be added to the team. 4. Similarly, you can remove the user from a team, create a new channel or remove any team channel or else remove any group, etc. All these cmdlets can be run as end users, but it will only work for the teams you own, or you are a member of that team. As a global admin, you will be able to act on all the teams. Managing MS Teams policies via PowerShell: 1. Download and install Skype for Business PowerShell Module. 2. Connect with Skype for Business PowerShell Module. Open Windows PowerShell and run the following commands: “Import-Module SkypeOnlineConnector” “$userCredential = Get-Credential” “$sfbSession = New-CsOnlineSession -Credential $userCredential” “Import-PSSession $sfbSession” Now you are connected to Skype for Business PowerShell Module. 3. There are basically 5 commands to manage the policies. GET – Get the details of the policy. NEW – Create new policies. SET – Lets you set particular values on a given policy. REMOVE – Delete the customs policy. GRANT – Assign policy to particular user.For e.g, you want to get the details of all the meeting policy, run command “Get-CsTeamsMeetingPolicy” You will be able to get the details of the all the meeting policy whether it has been created by Microsoft or it is a custom policy that will be shown. Similarly, for Messaging policy run command “Get-CsTeamsMessagingPolicy” Managing configurations via PowerShell: Connect to Skype for Business PowerShell Module. You have seen above how to connect to Skype for Business PS Module. Run command “Get-CsTeamsClientConfiguration”. This is basically your Teams settings in the admin center. Conclusion: Administrators can manage a good set of tools in Microsoft Teams through Microsoft Teams admin center and also through PowerShell. In this article, we have seen how easily we can connect through PowerShell and can manage things.
Share Story :
Linking of Sales Order and Sales Order Lines in Microsoft PowerApps.
Introduction: In this blog I will demonstrate that how the Sales Order and its corresponding Sales Order Lines can be linked together in the Microsoft PowerApps. Pre-requisites: Microsoft PowerApps Method: Create two galleries within the PowerApps and for the first gallery create a display form with Sales Order as the Data source. In the second gallery, the Sales Order Lines is the Data source. Now select the second gallery, and write the following formula to display the corresponding Sales Order lines: Filter(SalesOrderLines,’Document No.’ exactin DataCardValue2.Text) where DataCardValue2.text contains the value of ‘No.’ field of the Sales Order on the basis of which the Sales Order and its lines are related. The exact in keyword is used to check whether both the fields are matching exactly.
Share Story :
Role Center(Dashboard) taking forever to Load? Let’s find out why and how to optimize!
Introduction: Have you ever faced the issue of the Dashboard taking forever to load? If yes, then did you inspect the reason why? Anyways, the Dashboard loading times dependent upon the calculations used to generate the figures on each of the dashboard tile. Most of the times the calculations are so tedious that the results involve querying multiple tables with multiple filters. Let’s see how we can optimize the Dashboard load times. Pre-requisites: Microsoft Dynamics NAV / Business Central. Development Environment or NAV. VS code with AL Language Extension for Business Central. Solution: 1. Figuring out which all tiles required real-time calculations VS non- real-time. Thus, by separating real-time from non- real-time, we can differentiate the execution patterns. For eg: No. of Open Invoices VS Average Cost of an Open Invoice. 2. Settings different execution styles for Real-Time and Non-Realtime: i. Real-Time Calculations are trigger whenever we open the Dashboard i.e OnOpenPage Trigger on Role center page ii. Whereas Non-Real time can be set up as Job which refreshes every 5-10 minutes. 3. Setting the Dashboard Source of Data as Tables. It is easier for the Dashboard to Load the data from Tables rather than executing the query and storing the data as variables and populate data. 4. Setting manual Refresh Button to refresh the data on all the tiles. Code & Output: 1. Creating the Role Center with Source Table as the Table: 2. Trigger on OnOpenPage to modify the values in the Source Table with new real-time values: 3. Create a Codeunit which run as a Job every 5 – 10 minutes and store the data into the Source Table: Creating Codeunit to be executed as a Job. Setting Codeunit on Job Queue Entries 4. Output: Conclusion: Thus using the optimization by using Table as the source of data for Role Center, we can reduce the load time exponentially to get a good performance. As per facts are concerned, in reality, the change in the load time was from 2 minutes 10 seconds to 15 seconds after the optimization.Happy Blogging! 🙂
Share Story :
Infinite_Loop_Fetchxml
Introduction While using fetch XML to retrieve records more than 5000 records and if you have multiple entities involve in it. There are chances that you will get into an infinite loop even if you have less than 5000 records. Description: We have noticed that after 9.0 if you are using the old method to retrieve more that 5000 records using the fetch xml in the script it is possible that you will get the into infilter loop. This happens due to the internal multiplication of table which gives fist and last records id same in fetch xml You need to make sure that include the header as shown in the below screen Need to make sure that you have below check condition before calling the fetch next record collection if (data[“@Microsoft.Dynamics.CRM.fetchxmlpagingcookie”] != null && data[“@Microsoft.Dynamics.CRM.morerecords”] != null && data[“@Microsoft.Dynamics.CRM.morerecords”]==true) { It has more than 1 record true only than call the next request. Conclusion Hope this helps you to solve your infinite loop issue.
