Does any of you know how to install an earlier version of an extension? Normally I wouldn't do this, but in my case we are creating a new container with the standard image. This comes with a long list pre-published extensions. The first step in my build is to remove these Microsoft extensions by uninstalling and unpublishing them (without saving data). But one of them we are going to install again, but in the version we have approved and verified works. Compared to the one in container, then it's version is lower, so when BC writes "Cannot synchronize extension XXX because a newer version has already been synchronized." then this is not a surprise. Is there a way to "force" this older version back into the system, or is this simply not possible?
↧
Forum Post: Publish an earlier version of an extension
↧
Forum Post: RE: SETRANGE not applicable on value red|blue
Hi MDSRK365, This line seems to be missing from your code : UserSetup .SETRANGE("User ID",USERID);
↧
↧
Forum Post: RE: SETRANGE not applicable on value red|blue
i have tried that also but not working
↧
Forum Post: RE: SETRANGE not applicable on value red|blue
Alright. I think there is something wrong with your logic here. You want to prevent users with certain location code to post item journal, is that correct ? If so, I recommend you to add a field (a boolean) in the Location table to identify which Location you want to block. For example, you create the field "Allow posting item journal", and you don't check it for Blue and Red locations, and check it for the others. Then, in the post action you do : UserSetup.RESET; UserSetup.SETRANGE("User ID",USERID); UserSetup.SETRANGE("Loc area",Rec."Location Code"); //Rec can contain multiple Location Codes, so... IF UserSetup.FINDFIRST THEN BEGIN Location.RESET; Location.SETRANGE("Allow posting journal",TRUE); Location.SETRANGE(Code,UserSetup."Loc area"); IF Location.FINDFIRST THEN BEGIN CODEUNIT.RUN(CODEUNIT::"Item Jnl.-Post",Rec); CurrentJnlBatchName := GETRANGEMAX("Journal Batch Name"); CurrPage.UPDATE(FALSE); END ELSE ERROR('USER NOT VALID FOR THIS LOCATION: %1',"Location Code"); END ELSE ERROR('User setup does not exist for %1, location : %2',USERID,Rec."Location Code"); Of course, you have to create every user who are likely to post item journal in the User Setup Table.
↧
Forum Post: RE: SETRANGE not applicable on value red|blue
i will try this and let you know thanks
↧
↧
Blog Post: Dynamics 365 Business Central Wave 2: customizing the Base Application
In a previous post I described how you can start building extensions for the upcoming Dynamics 365 Business Central Wave 2 release on top of the Microsoft’s System Application . Today I want to show you how you can directly customize the Microsoft’s Base Application (alias, the standard Microsoft codebase). This is a top request I receive every day on all the partners I met, but before starting this post, I want to put in evidence what I think (receiving this question so often is not a good sign): please avoid to do this as much as possible . From the Wave 2 release, Microsoft will permit you to modify the Base Application if needed but you should do this only if you cannot solve problems with the standard extension’s model. Please always remember that in this way you’re working like in the past. Said that (very important to remember!) let’s start Starting from a development environment based on a Docker container with the Wave 2 release, the first step to do is to extract the Microsoft’s source code in a local folder. You can do that with the following Powershell command: $alProjectFolder = "C:\SD\BaseApp" Create-AlProjectFolderFromBcContainer -containerName $containerName ` -alProjectFolder $alProjectFolder ` -useBaseLine -useBaseAppProperties -addGIT This command extracts all the Microsoft’s source code (.AL files) in the specified folder and creates a Visual Studio Code project ready to go, with launch.json configured for your enviroment. When you start this command, there’s an important option to consider: you can create a totally new Base Application (custom appID and Publisher ) or you can use the Microsoft’s standard Base Application appID and Publisher . I prefer this second option (because it permits you to handle dependencies from the Base Application in the default standard installed apps like Intelligent Cloud Base , Sales and Inventory Forecast , Paypal etc. in a transparent way) so I’ve specified the -useBaseAppProperties setting. Now start this comand: and your AL folder file will be ready to go (you can also have files organized automatically by using the -alFileStructure option). In this folder you have all Microsoft’s standard objects (.AL files), a l aunch.json file and an app.json file for your extension. As you can see, the app.json file is configured with the same parameters as the standard Microsoft’s Base Application and it has a dependency from the System Application : Please also note that Target is set to onPrem (you cannot do that on a SaaS environment). You now need to download dependencies (as usual) in order to have symbols recognized. You will see a lot of warnings too in your project (future deprecated things): What we want to do now is a (stupid for simplicity) modification to the Microsoft’s Base Application, so as a first step I change the version number from 15.0.36145. 0 (Microsoft’s standard number) to 15.0.36145. 1 (new minor version). Then we implement our modification directly on the standard Microsoft’s objects. Here I directly modify the Customer table in order to add a new field called SD : and then I directly modify the Customer List page in order to add that field to the page: P.S. This is just a simple example, there are tableextension and pageextension objects for this Imagine to do more complex customizations like modifying standard codeunits etc. Now our code modification is complete and we can compile the app with Visual Studio Code. If all is ok you will have a file called Microsoft_Base Application_15.0.36145.1.app in your folder: Now we have to publish our customized Base Application . For doing that, we can uninstall the existing Microsoft’s Base Application and all its dependent extensions: If now you try to publish your custom Base Application from Visual Studio Code, you will receive an error like the following: “The extension could not be deployed because it’s already deployed on another tenant”. Why this? Because Microsoft’s Base Application is deployed with a Global scope and you cannot publish an app with the Global scope. To publish your custom Base Application , you need to use the Tenant scope, so start the following command: Publish-NavContainerApp -appFile "C:\SD\BaseApp\Microsoft_Base Application_15.0.36145.1.app" -containerName $containerName -install -scope Tenant -skipVerification -sync Maybe you should also use the following command after the app installation: Start-NavContainerAppDataUpgrade -appName "Base Application" -appVersion 15.0.36145.1 -containerName $containerName At the end of this process, you have your customized Base Application installed: You need to also republish the standard Microsoft’s dependent extensions if you want to have all the previous functionalities available again: Now you’re ready to go! In our example, if we open the Customer List page, we can see our new SD field (added with the direct modification inside the Base Application ): As you can see in this post: With Dynamics 365 Business Central Wave 2 release, you can modify the Base Application again by directly altering the Microsoft’s standard objects This code base modification works only for on-premise scenarios If you take this direction, you’re creating a brand new app and you’re not compliant with future releases. In the future, you will have to merge your code again. I repeat myself again: please avoid this as much as possible. This is not the best practice to do and in this way your extension is not ready for the cloud. Remember always that “ in the future, on-premise will follow cloud rules “.
↧
Forum Post: RE: What is the best way to break into NAV?
Where do you want to dig into, Functional side OR the Technical One.
↧
Forum Post: How to indent dataitems in Query in NAV 2018
Hi All, I am creating a query using Job, Job Task,Job Planning Line,Job Ledger Entry and Job WIP G/L Entry tables. I have indented them as below DataItemLink in each dataitem is as Job No.=FILTER(<>'') Job Task Job No.=Job."No." Job Planning Line Job No.=Job_Task."Job No.",Job Task No.=Job_Task."Job Task No." Job Ledger Entry Job No.=Job_Task."Job No.",Job Task No.=Job_Task."Job Task No." Job WIP G/L Entry Job No.=Job."No.",Job No.=Job_Task."Job Task No." now the scenario is : I have a job task line, which has 4 job planning lines and 4 ledger entries and 0 WIP G/L entries. According to me query o/p should be only 4 lines. but I am getting output of query as 16 lines(i think 4*4). where job planning lines are repeating 4 times. Can some one tell me where I am doing wrong? Thanks in advance.
↧
Forum Post: RE: How to display JPY Currency Factor as 106.55, not 0.00938
Hi Chris, You are right, collective opinion will support you in this. Field "Currency Factor" always contains the exchange rate from the local currency (JPY) to the document currency (USD), there is no setup option to show it the other way round. I wouldn't probably extend the table with another field for this purpose - would rather opt for a function to revert the value "on the fly". But this depends on the situation, of course.
↧
↧
Blog Post: Dynamics 365 Business Central APIs, Powershell, CSV and a bit of fancy notifications
In one of my last development workshops for Microsoft Italy, when talking about Dynamics 365 Business Central APIs, I’ve done a small demo on how to retrieve data from APIs directly from a Powershell script and save those data in a CSV file. Due to a lack of time, I’ve not talked too much about that script but (attendees will remember that) it ended in the following way: This is a classical Windows 10 Toast notification, that automatically appears when something occours and it remains active in your notification’s area. Toast notifications are a part of the new modern UI of Windows 10 which are shown in rectangular shape using slide-in and slide-out animations. When I have some long running scripts I often use notifications like this. To create such notifications with Powershell, I’ve used a Powershell module called BurnToast . This module permits you to create different types of toast notifications directly from Powershell (like simple toast, toast with logos and sounds, toast with reminders, toast with progress bar etc.). To create a toast notification like the above image, is extremely simple. Just declare the text, header and logo of your toast and execute the New-BurntToastNotification cmdlet: Install-Module BurntToast $toastParams = @{ Text = "My notification message" Header = (New-BTHeader -Id 1 -Title "My toast title") AppLogo = "C:\YourLogo.png" } New-BurntToastNotification @toastParams Extremely easy… What about the Powershell script executed during my demo? It did the following: Connects to the Dynamics 365 Business Central Customer API Retrieves the data as JSON Prints the retrieved data on screen Saves the retrieved data on a CSV file Shows a toast notification to notify that the job is finished and the CSV data export is ready to be used If you know a bit of Powershell, I think that the script is quite self explanatory (and it could be write better for sure): $user = 'YourD365BCUser'; $wsKey = 'YourD365BCWebServiceAccessKey'; $tenantID= 'YourTenantID'; $companyId = 'YourCompanyID'; $credentials = "$($user):$($wsKey)" $encodedCredentials = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($credentials)) $headers = @{ Authorization = "Basic $encodedCredentials" } $url = "https://api.businesscentral.dynamics.com/v2.0/" + $tenantID + "/production/api/v1.0/companies(" + $companyId + ")/customers"; $jsonResponse = Invoke-RestMethod -Uri $url -Method GET -Headers $headers | ConvertTo-Json | ConvertFrom-Json $toastParams = @{ Text = "Customers retrieved from Dynamics 365 Business Central and data saved on CSV file" Header = (New-BTHeader -Id 1 -Title "D365BC API Call from Powershell") AppLogo = "C:\YourLogo.PNG" } Write-Host "Number of Customers retrieved: " $jsonResponse.value.Count foreach ($cust in $jsonResponse.value) { Write-Host "$($cust.number) - $($cust.displayName)" } #Save CSV file $file = "C:\TEMP\data.csv" $jsonResponse.value | Select number,displayName | ConvertTo-CSV -NoTypeInformation | Out-File $file #Display a toast notification to the user New-BurntToastNotification @toastParams Complete script code is also available here . Why I’ve presented this script? Not mainly for the fancy notification (obviously) but: Because it shows how you can use Dynamics 365 Business Central APIs from Powershell Because it shows a performant way to avoid using XMLport objects for exporting data from D365BC.
↧
Blog Post: New logo for Microsoft Dynamics 365 Business Central
Small message that I just needed to share :-). As said – I’m prepping my sessions for Directions, which basically means: I’m spending all my free time in “Business Central” these days. No printing, hardly any social contacts … . And while publishing to SaaS, I noticed this when I refreshed my page: That’s right! A new logo, people! (I should say “Icon” actually, but you know what I mean). Let’s have a closer look: Doesn’t look bad! Not bad at all .. But it does mean I’ll have to redesign my 3D printed logo ;-). And I will … I so will .. . As I said on twitter earlier today: I’m so distracted now that I have to first make sure that I started a new print with a new concept before I can continue prepping my sessions :-).
↧
Forum Post: How to choose a specific sandbox ti connect on visual studio code
Hello everyone, I'm getting started with extension, and I want to start developping with visual studio code. My question is : il I have 3 sandbox environments how can I choose a specific one when I'm connecting to sandbox in visual studio code? Thanks in advance.
↧
Blog Post: Dynamics 365 Business Central: checking Users Plans in Wave 2 release
Checking which plan is assigned to a specific user (Essential, Premium, Team Member) is become a quite different thing with the Wave 2 release (version 15). Users plans are now managed in the System Application via the Azure AD Plan module . The Plan and User Plan tables are now marked as internal, so you must use the methods provided in this module to query them. How can you check if a user is an Essential, Premium or Team Member user with the version 15 release? You now have a query object called Users in Plans and you can use this object to retrieve the plans assigned to your user. For showing how to do this with the version 15 release, I’ve created a small extension that adds an action to the User Card page and then calls a GetUserPlan method defined in a custom codeunit. The method is defined as follows: The method uses the Users in Plans query by filtering for the USERID to check and then retrieves the Plan_Name and User_State fields. Output is like the following: Not so clear why a query object instead of a codeunit, but that is…
↧
↧
Forum Post: Error: Web service using web service
Hi everyone, I'm creating an exzecutable program, that calls to a function in a codeunit published as a WebService. If I run the CU, I don't have aby problem, but executin the exe program, I get this error: This is the code I'm calling from the executable file: ICforStock() //IC // IF NOT ISSERVICETIER THEN // EXIT; // IF NOT GUIALLOWED THEN // EXIT; lItem.SETCURRENTKEY("Item Category Code","Product Group Code"); lItem.SETRANGE("Item Category Code",'INSIZE'); IF lItem.FINDSET THEN REPEAT lItem.CALCFIELDS(Inventory,"Qty. on Sales Order"); lCantidad := lItem.Availability; ICStock_CALL(lItem."No.", lCantidad); UNTIL lItem.NEXT = 0; ICStock_CALL(pCodprod : Code[35];pCantidad : Decimal) CabVenta : Code[20] //Creamos conexión IC CLEAR(xmlhttp); CREATE(xmlhttp,FALSE,TRUE); ICConfiguration.GET; ICURL := ICConfiguration."IC URL"; xmlhttp.open('POST',ICURL,0,'betea','onM1crosoft1'); xmlhttp.setRequestHeader('Content-Type','text/xml; charset=utf-8'); xmlhttp.setRequestHeader('SOAPAction','FuncionesIC'); xmlhttp.setTimeouts(20000,20000,20000,200000); xmlhttp.send(' '+ ' '+ ' '+ ' '+ ' '+ ' '+pCodprod+' '+ ' '+FORMAT(pCantidad)+' '+ ' '+ ' '+ ' '); ICStock_FUN(pCodprod : Code[35];pCantidad : Text) EVALUATE(vCantidad,pCantidad); lItem.RESET; IF lItem.GET(pCodprod) THEN BEGIN lItem."Stock In IC" := vCantidad; lItem.MODIFY; END; Any hint about this? If I don't comment GUIALLOWED and SERVITIER, I don't get the error, but the functions aren't executed... Thank you all
↧
Blog Post: Microsoft Dynamics 365 Business Central 2019 release Wave 2 is released!
Sorry for the shortness of this blog (may be you like it that way ;-)) – but just a small reminder for anybody that has been sleeping under a rock for the last couple of days: Microsoft Dynamics 365 Business Central 2019 release Wave 2 is released! All you need to know is simply quite well documented by Microsoft. Let me give you a few links: Dynamics 365: 2019 release Wave 2 plan What’s new and planned for Dynamics 365 Business Central The download link for the OnPrem DVDs And yes, that’s right: C/AL is gone, and the RTC is gone as well! But together with that, a lot of goodies are being thrown in our lap! If you want to know more, read the above links, or come to Directions or NAVTechDays and learn from the very people that built it! It’s a big one – so build pipelines will break, code needs to be upgraded. I guess it’s time for action ;-). More to come ..
↧
Blog Post: Download Microsoft Dynamics 365 Business Central 2019 release Wave 2
Microsoft Dynamics 365 Business Central 2019 release Wave 2 is available to download. This page contains downloads of Microsoft Dynamics 365 Business Central on premises 2019 release wave 2 (October release), and related resources. https://mbs.microsoft.com/partnersource/global/support/support-news/bconpremdownload_2019_wave2 Release notes can be found in below link https://docs.microsoft.com/en-us/dynamics365-release-plan/2019wave2/dynamics365-business-central/ Product Downloads Microsoft Dynamics 365 Business Central on premises Download AU-Australia Download AT-Austria Download BE-Belgium Download CZ-Czech Republic Download DK-Denmark Download FI-Finland Download FR-France Download DE-Germany Download IS-Iceland Download IT-Italy Download MX-Mexico Download NL-Netherlands Download NZ-New Zealand Download NO-Norway Download ES-Spain Download SE-Sweden Download CH-Switzerland Download UK-United Kingdom Download NA-North America Download RU-Russia Download W1
↧
Forum Post: Your extension is incompatible with an upcoming release of Microsoft Dynamics 365 Business Central
Hi everyone, I've received a few mails with this issue. I have 2 reports with this issue into a customers tennant, in a cloud version. Today, I've pulled a BC15 version into a docker, and fixed those reports. But when I'm trying to deploy the extension into the tenant, I get this error: "The runtime version of the extension package is currently set to '4.0'. The runtime version must be set to '3.2' or earlier in the app.json file in order to install the extension package on this server." What should I do? I understand that the tenant should be upgraded to the BC15, but hown can I do that? I msut way the 90 days I have to fix the extension version errors? Thank you very much
↧
↧
Blog Post: Tip #62 | “Where-Used” in Visual Studio Code
The “Where-Used” in Visual Studio Code is nice, but not always productive. Today I wanted to see where a field was used and came up with an alternative I wanted to share. ObsoleteState If you mark a field ObsoleteState::Pending the compile will throw warnings everywhere the field is used. This allows you to quickly use the error window to jump through the code and check whatever you want to check. When finished you set the obsolete state back.
↧
Forum Post: RE: Your extension is incompatible with an upcoming release of Microsoft Dynamics 365 Business Central
Did you try updating your "AL Language" extension in VS Code? you have to upgrade it to the new version which is 4.0.. and with that you can setup your runtime to 4.0
↧
Forum Post: RE: How to choose a specific sandbox ti connect on visual studio code
Found it, I had to add the 'sandbox name' property in the launch.json and put the name of the sandbox that I want.
↧