Quantcast
Channel: Microsoft Dynamics NAV
Viewing all 64865 articles
Browse latest View live

Forum Post: How to print a defined number of reports?!

$
0
0
Hey guys, I would like to print a report as often as I have it previously defined. For example I would like to print a report five times. Another time I want eight printouts. One condition is the report should be loaded only once... Otherwise the performance would be significantly worsened... To create the layouts of my reports I use "Document Creator". And there I have seen that there is a field called "Copies": Can I control this from NAV to place a certain value in here? Do you have any ideas? Thank you :)

Blog Post: Dynamics 365 Business Central + Azure Cosmos DB for globally distributed integrations

$
0
0
Today’s post wants to give an overview of a successfully deployed scenario of a geo-distributed integration between Dynamics 365 Business Central and some local B2B applications and it wants to leave a message to all: enlarge your vision to other Azure services if you want to create globally distributed architectures that rocks! The scenario: The headquarter of a large commercial company is located on West Europe and it’s using Dynamics 365 Business Central SaaS as the main ERP system. This company creates items and when these items are ready for selling worldwide, they have the need to distribute their database (product catalog) to every point of selling in the world (on many countries on different continents in the globe). The point of selling (shops) have locally installed apps that reads this product catalog to immediately know what items can be sold, price, availability and so on. The first solution: The fist solution was to use Dynamics 365 Business Central APIs. The geo-distributed local apps call custom D365BC API pages and retrieves the data. This solution had two main “problems”: some contries experiences long latency on retrieving data too much API requests are forwarded to the D365BC tenant during the day The second solution: The second solution was to use Azure SQL as an “intermediate layer”: D365BC sends items records to an Azure SQL database by calling an Azure Function and then the local apps calls other Azure Functions for retrieving the data from this “centralized” Azure SQL database instance. Pros and cons of this solution: The D365BC tenant does not have to handle too much requests for data some contries experiences long latency on retrieving data Cost increased The main problem to handle for having a good architecture for this scenario was to avoid big latencies on some countries. For reaching this goal, data should be as near as possible to the local application (so on every contries where the company has a shop). For this business case, data has no strictly the need to have a relational database under the hood, but we can use also a NoSQL database. Final solution: The solution that reached all the goals is described in the following schema: For this solution we’re using an instance of Azure Cosmos DB for storing item’s data. Azure Cosmos DB is Microsoft’s globally distributed, low-latency, high throughput, always on, multi-model database service. Azure Cosmos DB is a no-sql database and one of the key benefits of Azure Cosmos DB is that it transparently replicates your data wherever your users are, so your users can interact with a replica of the data that is closest to them. Azure Cosmos DB allows you to add or remove any of the Azure regions to your Cosmos account at any time, with a click of a button. In our scenario, we have an instance of Azure Cosmos DB in West Europe. On the same region we have an Azure Function that is called from Dynamics 365 Business Central for storing item’s data into an Azure Cosmos DB document collection. Items are stored as JSON documents. Then, the Azure Cosmos DB database is geo-replicated into N different Azure regions we need for our business. The local applications rerieve the item’s data by calling an Azure Function that in turns retrieves the data from it’s nearest Azure Cosmos DB database. The calls is managed by an Azure Traffic Manager that redirects it to the right Azure Function (region). The main Azure Cosmos DB is created from the Azure Portal as follows: The Azure Function used for sending the items data from Dynamics 365 Business Central to Azure Cosmos DB is an Http Trigger deployed to the same Azure region. The function (called SendItemsToCosmosDB ) uses the Microsoft.Azure.DocumentDB.Core package and it’s defined as follows: [FunctionName("SendItemsToCosmosDB")] public static async Task Run( [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req, ILogger log, Microsoft.Azure.WebJobs.ExecutionContext context) { log.LogInformation("C# HTTP trigger function processed a request."); //Reads incoming JSON string requestBody = await new StreamReader(req.Body).ReadToEndAsync(); dynamic data = JsonConvert.DeserializeObject(requestBody); //Read settings.json var config = new ConfigurationBuilder() .SetBasePath(context.FunctionAppDirectory) .AddJsonFile("local.settings.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables() .Build(); CosmosDBEndpoint = config["CosmosDBEndpoint"]; CosmosDBMasterKey = config["CosmosDBMasterKey"]; SaveItemToCosmosDB(data); return ItemNo != null ? (ActionResult)new OkObjectResult($"Item {ItemNo} stored.") : new BadRequestObjectResult("Error on input data."); } The Azure Function supports the http POST method. It receive a JSON document as input (item representation), it retrieves the Azure Cosmos DB parameters from the configuration settings (endpoint and primary key, you can retrieve them from Azure Portal by going to your Cosmos DB database and clicking on Keys ) and then saves the item document (JSON) to the Azure Cosmos DB main instance. The method that stored the JSON data on Azure Cosmos DB is called SaveItemToCosmosDB and it’s defined as follows: private static void SaveItemToCosmosDB(dynamic Item) { Task.Run(async () => { using (var client = new DocumentClient(new Uri(CosmosDBEndpoint), CosmosDBMasterKey)) { //Create new Cosmos DB database (if not exists) var databaseDefinition = new Database { Id = "ItemDb" }; var database = await client.CreateDatabaseIfNotExistsAsync(databaseDefinition); //Create a new database collection (a database is a container that holds a number of collections) var collectionDefinition = new DocumentCollection { Id = "ItemCollection" }; var collection = await client.CreateDocumentCollectionIfNotExistsAsync(UriFactory.CreateDatabaseUri("ItemDb"), collectionDefinition); //Insert the document in the collection //To insert new document, you need two things: //Path to collection: dbo /{ databaseName}/ colls /{ collectionName} //Document Object var itemDocument = await client.CreateDocumentAsync( UriFactory.CreateDocumentCollectionUri("ItemDb", "ItemCollection"),Item); } }).Wait(); } I’ve placed comments between code lines, so I think it’s quite self-explanatory: we create a new database (if it doesn not exists, here called ItemDB ), we create a Document Collection ((if it doesn not exists, here called ItemCollection ) and we create a document on this collection with the JSON received as input from Dynamics 365 Business Central). This Azure Function is called from AL by passing a JSON representation of an Item. The AL procedure code is as follows: procedure SendItem(ItemNo: Code[20]) var httpClient: HttpClient; httpContent: HttpContent; jsonBody: text; httpResponse: HttpResponseMessage; httpHeader: HttpHeaders; Item: record Item; begin jsonBody := ' {"itemNo":"' + item."No." + '","itemDescription":"' + Item.Description + '","itemEnabledForSelling":' + format(Item."Enabled For Global Selling") +'}'; httpContent.WriteFrom(jsonBody); httpContent.GetHeaders(httpHeader); httpHeader.Remove('Content-Type'); httpHeader.Add('Content-Type', 'application/json'); httpClient.Post(BaseFunctionURL, httpContent, httpResponse); //Here we should read the response message('Item registered on Azure Cosmos DB.'); end; When the Azure Function is called, we have an HTTP response like the following: If we check our Azure Cosmos DB via the data explorer in Azure Portal, we can see that the item document is stored: Azure Cosmos DB adds an ID to the document record itself + other internal fields. The main Azure Cosmos DB database is geo-replicated on every Azure region we need for our business. The geo-replication can be easily performed directly via the Azure Portal by selection your Azure Cosmos DB instance, then going on Replicate data globally . Here you can select with a click all the region where you want the database replica and if you want a read-only replica or also write enabled: Thats’s done! Your no-sql database is replicated geographically! The Azure Cosmos DB is created by selecting the Core (SQL) API (see figure 1). This means that your database supports querying items using Structured Query Language (SQL) as a JSON query language, so you can perform sQL-like query on your unstructured data for retrieving items. The Azure Function that retrieves the data (here called GetItemsFromCosmosDB ) is defined as follows: [FunctionName("GetItemsFromCosmosDB")] public static async Task GetItems( [HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req, ILogger log, Microsoft.Azure.WebJobs.ExecutionContext context) { log.LogInformation("C# HTTP trigger function processed a request."); string requestBody = await new StreamReader(req.Body).ReadToEndAsync(); //Read settings.json var config = new ConfigurationBuilder() .SetBasePath(context.FunctionAppDirectory) .AddJsonFile("local.settings.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables() .Build(); CosmosDBEndpoint = config["CosmosDBEndpoint"]; CosmosDBMasterKey = config["CosmosDBMasterKey"]; string jsonResponse = GetCosmosDBItems(); return jsonResponse != null ? (ActionResult)new OkObjectResult(jsonResponse) : new BadRequestObjectResult("Error on retrieving data."); } The method that retrieves the Item document from Azure Cosmos DB (here called GetCosmosDBItems ) is defined as follows: private static string GetCosmosDBItems() { string Json = string.Empty; using (var client = new DocumentClient(new Uri(CosmosDBEndpoint), CosmosDBMasterKey)) { var response = client.CreateDocumentQuery(UriFactory.CreateDocumentCollectionUri("ItemDb", "ItemCollection"), "select * from c").ToList(); Json = JsonConvert.SerializeObject(response); } return Json; } The methods performs a sql-like query on our collection and returns all data. Obviously, you can adapt this method to perform the query you need. If you send a GET request to this Azure Function, this is the response received: It returns the JSON representation of your document collection data (our Item records stored). Gain on performances and latency? From 5% (same Azure Region as the Dynamics 365 Business Central instance) to more than 50% (or remote regions). I think this is something that must be keep in mind…

Forum Post: RE: Date Range Filter

$
0
0
Add the code in the on open page trigger to calculate start date and end date using TODAY AND CALCDATE functions and apply the filter on document date using those calculated dates

Forum Post: RE: Show all "Customer" fields in Customer list columns

$
0
0
You have the only columns available which you have added to the page, if you don’t see other columns you need to design the page in development to add the missing fields. The other option is to use rapid start to export.

Blog Post: Power BI Deployment Reports Tips for Business Central Users

$
0
0
“Publish and Deploy Power BI Dashboard and Reports to users using alternative scenarios” In addition to integrating Power BI into Business Central, it could be useful to be able to use a fast access portal or receive scheduled reports from Power BI automatically without going through the complete Power BI (Pro and Premium) solution. All this is already existing and usable if I use Power BI Premium license or Pro license, or if I integrate MS-Flow, MS-Sharepoint Online etc. etc. With Power BI Pro license, you can publish and distribute any dashboard or report and manage users’ permissions and data segmentation\filtering for users. If you have only the FREE license, you can run ALL on Power BI Desktop but you can only publish and share with no permissions. Report Publishing Assigning Permissions Power BI Pricing (PRO & PREMIUM) https://powerbi.microsoft.com/it-it/pricing/ WORKAROUNDS – Alternative Solutions Now we will see some tips that these are just small workarounds that could be useful; you can automate a minimum the creation of Dashboards and Power BI reports and distribute them to users via email. EXAMPLE FOR A SIMPLE USER’S SCENARIO To Publish, Deploy and email reports you only need: One Power BI Pro License – to schedule data update more times during the day, in other cases, you can use FREE license. Google Sites – to publish Dashboard and Reports Links and manage user’s permission FAST (like in Business Central or from email link) Powershell & Excel – to deploy PDF Files to Partners via email. #1 – Publish on Google Site with Google integrated Security Publish Power Bi Dashbords\reportss on Google Site Manage Permissions from Google Admin Center, you can map and use your Business Central account. Publish and share the page to users. Example: https://sites.google.com/view/POWERBI_MASTER_PAGE/?hl=it What can you do? You can add ALL published Reports in the Master Browser page (or create more than a single page); you can Add\Manage permission to Open Master Browser Page to users and add link for other Power BI Dashboard like a Portal; you can use Google site as a BLOG managing user security. You can also abbreviate and crypt link if necessary. Shorted Link-example http://tiny.cc/trAjd8y #2-Use PowerShell Integration Script to Print & Distribute Excel Files in PDF Format with data created in Power BI. With a little Powershell Script you can ad example: Save Excel report from Power BI Report Filter Excel Report Create various PDF filtering Excel Reports Send email with PDF attachments Schema A “part” of simple script (and technology) to Filter Excel reports and deploy Reports to users in PDF Format # PATH – define the Folder Path $path = “C:\temp\PowerBI\REPORT_DISTRIBUTION\” # Open Excel Application (ComObject) $xl = New-Object -ComObject excel.application # Assign Path & File Names $pathXls = $line #$pathPdf = $PSScriptRoot + “\” + $pathXls + “.pdf” # Open the first excel sheet on Excel Workbook $wb = $xl.Workbooks.Open($path + $pathXls) $ws = $wb.ActiveSheet # ACCESS TO PIVOT TABLE AND APPLY FILTER SETS (ex AddMonth-1) $pivot = $ws.PivotTables(“Pivot_Table1”) $pivot_field = $pivot.PivotFields([int]$split[0]) # Addmonth(-1) example of Power Pivot Filter $pivot_field.CurrentPagename = “[Date].[Month].&[“+$d.AddMonths(-1).ToString(“yyyy-MM-01T00:00:00″)+”]” # Save the XLS File after completition $wb.Save() # Remove existing file if existing if(Test-Path -Path $pathPdf) { Remove-Item -Path $pathPdf } # Export from Excel to PDF File format (after filtering) $xlFixedFormat = “Microsoft.Office.Interop.Excel.xlFixedFormatType” -as [type] $ws.ExportAsFixedFormat($xlFixedFormat::xlTypePDF, $pathPdf) # Send Email (SMTP) with attached PDF Files $SMTPClient = New-Object System.Net.Mail.SmtpClient(“Server IP”, portNo.) $msg = New-Object System.Net.Mail.MailMessage(“sender@sender.it”, $dest[0], $mailOBJECT,$mailtext) $attach = New-Object System.Net.Mail.Attachment($pathPdf) $SMTPClient.Send($msg) #3 – Another solution to Schedule and Distribute Reports: PBRS PBRS (Power BI Reports Scheduler) : “Automated filtering, scheduling & distribution of Power BI Reports & Dashboards” PBRS (Power BI Reports Scheduler) saves time and money by making it easy to automate the filtering, distribution & delivery of Power BI Reports & Dashboards. Simply define single or packages of Power BI reports, schedule, run them automatically, and send the reports to print, fax, folder, FTP, SMS, Dropbox, SharePoint, Google Drive, Google Sheets, Slack & email in a number of standard formats including Excel, Excel Data Only, CSV, MS Word, PDF, HTML and more. https://go.christiansteven.com/power-bi-reports-scheduler-power-bi-reports-distribution-pbrs #4 –Use Power BI Report Builder to create reports using Power BI Datasets @1 of July , Microsoft dropped the latest update to Power BI Report Builder in the download center. It includes, for the first time, the ability to connect to your Power BI datasets, whether or not they are backed by premium capacity. This means any Power BI Pro user can connect to and author, render and export reports locally against her or his Power BI datasets with Power BI Report Builder . https://powerbi.microsoft.com/en-us/blog/announcing-support-for-non-premium-power-bi-datasets-in-power-bi-paginated-report-builder/ https://docs.microsoft.com/en-us/power-bi/paginated-reports-quickstart-aw

Comment on How to publish your Business Central App on AppSource

$
0
0
Hello Dmitry! Very good post, very interesting and useful. I have a question, if I want to create an app for business central on-premise, should I follow the same steps? I tried to find apps published for this business central version but I did not find any. Thanks

Forum Post: RE: SetData() and GetData() on NAV Reporting Layout

$
0
0
Hey Franz, I would like to print one report always two times. I have seen your explanation. Unclear is for me how I fill the Value...where does the layout get my value for example 2?

Forum Post: RE: Show all "Customer" fields in Customer list columns

$
0
0
Not all the fields are available on the Customer List. You will need to customize (design) it to show the field.

Forum Post: RE: Date Range Filter

$
0
0
Try doing a document date filter -30D.. You can then save the filter view to have it available on the menu.

Forum Post: RE: How to print a defined number of reports?!

$
0
0
Check Report 205 : Order Confirmation for references. There is a NoOfCopies that you can apply to an Integer data item for looping.

Forum Post: RE: Update Dimensions onValidate() of Location in Item Journal Line in NAV

$
0
0
Go to Item Journal Line and take a look at how they do Dimension when validating the Item No. You will need to follow the same rule and replicate it to Location Code.

Forum Post: RE: Update Dimensions onValidate() of Location in Item Journal Line in NAV

$
0
0
Add the code in the OnAfterValidate of the Location code to update the Shortcut Dimension 1 Code and Dimension 2 Code. ItemJnlLine."Shortcut Dimension 1 Code" := 'abc..'; ItemJnlLine."Shortcut Dimension 2 Code" := 'a1222' DimMgt.UpdateGlobalDimFromDimSetID( ItemJnlLine."Dimension Set ID",ItemJnlLine."Shortcut Dimension 1 Code",ItemJnlLine."Shortcut Dimension 2 Code");

Forum Post: RE: Client change to other company

$
0
0
I believe you are referring to the contact/customer record, and we don't have any standard functionality to copy master data, you can use the rapid start to export and update the values you need and re-import again.

Blog Post: Документация по российской локализации Dynamics 365 Business Central

$
0
0
Всем привет! Сегодня хотелось бы порадовать хорошей новостью всех, кто ждет документацию по российской локализации Dynamics 365 Business Central. На этой неделе Microsoft опубликовал документацию на сайте docs.microsoft.com . На текущий момент пока доступна только версия на английском языке ( https://docs.microsoft.com/en-us/dynamics365/business-central/localfunctionality/russia/russia-local-functionality ) Следующим этапом будет публикация документации на русском языке и произойдет это до конца июля. Если у вас есть какие-то замечания или дополнения к текущей документации, то вы можете внести свои предложения по изменению/дополнению контента через GitHub. Microsoft после проверки вносимых изменений опубликует их на docs.microsoft.com .

Blog Post: How Do I: use Microsoft Flow with data from Microsoft Dynamics NAV 2017?

$
0
0
www.youtube.com/watch Learn how to use Microsoft Flow wih data from Microsoft Dynamics NAV 2017. The demonstration covers the following steps: - setting up NAV and Flow - creating an automated workflow - testing and showing results   Learn more at http://aka.ms/NAVGetReady or send us an e-mail on kschimke@microsoft.com

Blog Post: How Do I: Configure the Outlook Add in for Microsoft Dynamics NAV 2017?

$
0
0
www.youtube.com/watch This video demonstration covers the following steps: - the neccessary prerequisites to configure the Outlook Add-in - setup - usage Learn more at http://aka.ms/NAVGetReady or send an e-mail to kschimke@microsoft.com

Forum Post: Item ledger entry does not exist Entry No. = 0 when Posting Credit memo

$
0
0
Hi! I have an issue with posting purchase credit memos. I have created a new purchase credit memo with a line "Charge (item)" because i got a discount from the vendor after posting the purch invoice. On the line I add the amount of the discount. Then i go to Line-->Item charge assignment and use the function "Get receipt lines" and choose the line/lines. After that I use the "suggest Item charge assignment" and then choose "amount". Then I try to post the credit memo and got this error message: Do you know what is wrong?

Forum Post: How to print a title or caption in header of a report only in the page based on particular line item value?

$
0
0
Hello experts , Good Day ! Could you please suggest how can i get print the caption/title in the header based on particular line item? I have created a text variable example: "Heading" and i have provided the condition in "Sales_Header" dataitem OnAfterGetRecord(). But the problem is it is not printing particularly on that page where condition satisfies it just prints on every page else if i remove repeat until then it will pring only once. Please help !

Blog Post: Docs for the Russian local functionality for Dynamics 365 Business Central

$
0
0
You can get Dynamics 365 Business Central in many countries and regions across the world, including Russia. This includes access to context-sensitive Help articles for the base app. But the Learn more links on tooltips for those pages and fields that are part of the local functionality in the Russian version have not been working. This is because there was no Help to link to for historical reasons. But now there is! We’re delighted to announce that Awara IT have helped us create Help for the local functionality in the Russian version! Collaboration process As part of our collaboration, two people from Awara IT submitted pull requests to our GitHub repo with the source files for the Help. Now for the complicated: We have a public GitHub repo for all languages that Microsoft translates into. But the https://github.com/MicrosoftDocs/dynamics365smb-docs/ repo is particular because it’s the twin of our source repo. Our actual source files are in a private repo. This helps us manage the content on the Docs.microsoft.com site. We have a script that pulls any contributions from the public repo to the private repo. And from there, we have now published to the Docs.microsoft.com site: https://docs.microsoft.com/en-us/dynamics365/business-central/localfunctionality/russia/russia-local-functionality The content is available in English only at this point in time. Awara IT have also submitted the content in Russian, and we are now getting that ready for publishing. Why the delay? Because we have to fit the content into our existing translation processes where English is the starting point. Also still pending is the work to hook up the Help with the page objects, but we’re getting there bit by bit. Thanks! This would not have been possible without our collaboration with the smart people at Awara IT. They suggested it, and I was delighted to finally close a gap that we have had in the Help for a long time. This shows the strength of the Dynamics 365 Business Central community and our collective dedication to the success of our customers. My special thanks go to Aliia Salikhova and Diana Malina from Awara IT. With their pull requests, we have now proven that the collaboration process works. Good work, great collaboration, and a fully transparent process – this is the Dynamics 365 Business Central community at work! The post Docs for the Russian local functionality for Dynamics 365 Business Central appeared first on Dynamics 365 Blog .

Forum Post: RE: Error happened when try to update data

$
0
0
Hi Could you post your solution to this problem? I have similar errors and can't make it work. Best, Marek
Viewing all 64865 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>