Quantcast
Channel: Dynamics 365 Business Central/NAV User Group
Viewing all 11285 articles
Browse latest View live

Forum Post: RE: For a condition how I Assign Unit Price:=0 in Sales Order's Line

$
0
0
I solve this and your instruction helps me a lot....thank you once again sir.

Forum Post: RE: NAV 2016/2017 Development Environment

$
0
0
When I faced this problem, running the developer environment as an administrator, and selecting the correct nav service when compiling helped. If you select wrong nav service, then you will not be able to compile, you have to close the client and log back in. If you are using Development environment with SQL logins and with NavUserPassword authentication , you have to have same username and password in SQL and in NAV in order to make it work. - I will blog one day about this, it is worth a longer post. Development client and NAV service both have to have same authentication method. You cannot have Windows login in Development environment and NAVUserPassword in RTC at the same time. If you are using externally only NavUserPassword authentication, on developer's laptop, check file: C:\ProgramData\Microsoft\Microsoft Dynamics NAV\90\ClientUserSettings.config It has to have entries that reflect the NAV service in the Azure server in following elements: Server, ClientServicesPort, ServerInstance and ClientServicesCredentialType br, urpo

Blog Post: NAV 2017 client upgrade script

$
0
0
Hello all! Microsoft keeps updating our beloved NAV regularly. They provide both application hotfixes and platform hotfixes. Since there is plenty of blog posts about object update and merge already, this blog post concentrates on how to update the client binaries, a.k.a. platform. In the old days, Microsoft provided hotfix -folders named as ADCS, Applicaton Server, Classic Client etc, from where NAV technician then copied the contents to installed folders, for example Classic Client contents to C:\Program Files (x86)\Microsoft Dynamics NAV\60\Classic -folder. Since 2015 CU01, Microsoft declined this practise, and only publishes zipped installation DVD image where technicians then use Jorg's script Copy-UpdateFilesToBatchDirectory.ps1 to create UPDATEFILES folder with similar folder structure as the old fashioned way. I used to exploit this script a lot, since I am responsible of our development environments. However, in time this script has become a bit outdated because Cumulative Updates contain now more files and folders that have to be copied in other folders than the standard NAV installation folders. Especially this was true with NAV 2016 CU07 and its NavSip.dll, which caused me some gray hairs... The original script has been modified by many NAV technicians, and for example "removing the unnessessary files" part has ben modified heavily. For example the help files have been updated and the original script ignored them. Microsoft employees have later blogged more about upgrading the clients, for example this blog post gives nice hints how to do the trick with PowerShell. For these reasons I decided to write a script of my own. And since I am not (yet) a PowerShell guru, I wrote it in as an old fashioned .CMD script. All you have to do is unzip the installation folders from CU package, add the unzipped folder name to the script, and run it as an administrator. It first checks it is indeed run as an administrator, deletes the Zone information from the update files to prevent Blocking issue (by using sysinterals streams.exe, which is not included for copyright reasons), does some other checks (mainly x32/x64 tests), shuts down the services and then copies new files from the installation folders to installed folders. Pretty straightforward. I will provide my script for your convenience, and you are free to use and modify it as you please. Should you spread it around, please leave information about the original author in the script - both for the praise and blame :) If you have any improvement suggestions or other comments, the space below is at your disposal! And remember, I take no responsibility if you manage to destroy some environment with this script ;)

Forum Post: RE: Customer Start Balance Report

$
0
0
Hi sachin Yes, Opening Balance. So I need the Opening Balance for each Customer.

Blog Post: Set filter in report using Text variable in NAV - Tips, Tricks & Facts #10

$
0
0
Hello everyone, It's been a month since I have written any post. Well, sometimes the work is just as much to occupy all your time that you barely get time to do other stuff. The complete title of this post must be "Set filter in report using Text variable in which the user can use .. (aka range) and | (aka separator) in NAV" but never mind. I encountered this situation where I wanted to set filter on the report's dataitem using a text variable. So, I asked this question in some forums and got the answer which helped me resolve my problem and I want to share it with you guys too! We know that filters can be added using ReqFilterFields in dataitem of a Report in NAV but sometimes the system design is as such that the records we want to lookup and select, do not show in the page which is there in LookupPageID of the table we want to Lookup into. In my case, DataItem is Fixed Asset. LookupPageID on Fixed Asset table is Fixed Asset List. I have a field "Equipment Asset" in fixed asset table and SourceTableView in Fixed Asset List is 'WHERE(Equipment Asset=CONST(No))'. Therefore, if I want to filter on a record which is "Equipment Asset"=TRUE then these records will not show in the page when we lookup in the field which is available via ReqFilterFields in the report's request page. Now, there is another list page named Equipment FA in the system and SourceTableView in this list page is 'WHERE(Equipment Asset=CONST(Yes))'. So, to filter on the records where "Equipment Asset"=TRUE, I did the following: 1. In my report I took a variable FANoFilter and added in Request page. In the OnLookup Trigger of this variable, I have written the code as shown below, CLEAR(EquipmentFAList); FixedAsset.RESET; FixedAsset.SETRANGE("Equipment Asset",TRUE); EquipmentFAList.LOOKUPMODE(TRUE); EquipmentFAList.SETTABLEVIEW(FixedAsset); IF EquipmentFAList.RUNMODAL = ACTION::LookupOK THEN BEGIN EquipmentFAList.GETRECORD(FixedAsset); FANoFilter := FixedAsset."No."; END; 2. I added the code shown below is on Fixed Asset - OnPreDataItem() in the report, IF FANoFilter <> '' THEN "Fixed Asset".SETFILTER("No.",'%1',FANoFilter); If I select FA0001 in FANoFilter and execute the report, the report works fine! Now coming to the actual problem! >>> If I apply filter like FA0001..FA0010 or FA0001|FA0002 in this text variable (FANoFilter), the report does not consider this as a range or two FA nos., but it takes these filters as one FA no. and the report doesn't execute. 3. So to achieve the desired solution I replaced my code in Fixed Asset - OnPreDataItem() IF FANoFilter <> '' THEN "Fixed Asset".SETFILTER("No.",STRSUBSTNO('%1',FANoFilter)); Modify your SETFILTER code and use STRSUBSTNO as shown in the line above. This will do the job for you. Please comment if you do not get any part of this post. I will help you to clear your doubts. Keep Learning guys! Ishwar

Blog Post: Import a File and Export it as a ZIP file in NAV 2017

$
0
0
Hi guys, I did some R&D on the File Management codeunit (419) which is available in NAV and found out that it has pretty much all the functions related to files available in it. For example : For zipping a file, we no longer need third party software to do the job for us in NAV. Like this, there are many more functions available in this codeunit which we can use to our advantage and play with 'em. I have used some of the functions in an example which I will demonstrate below, Before starting, I want you to know that this post is not limited to just importing and zipping a file. I want to show you the ability of codeunit 419 and the functions available in it. I have used a couple of them in my code. I have developed a codeunit. When I run this codeunit object, a dialog opens up to select a file and then we may select any file of any type and NAV will import it and export it in the same folder as a ZIP file. STEP 1: Run the codeunit which opens up a dialog window as shown below, STEP 2: Check the folder from which I selected the file. I see a ZIP file as shown below, How did I accomplish this?? Create a new codeunit and declare the following Variables, Variables Name DataType Subtype Length FileMgt Codeunit File Management ServerFileName Text ClientFileName Text ZipFileName Text Code >>> CLEAR(FileMgt); //Get fob file on client machine ClientFileName := FileMgt.OpenFileDialog('Import a Word file', '', 'Word Files (*.doc)|*.doc|All Files (*.*)|*.*'); //Upload fob file to server and get the full path of the file ServerFileName := FileMgt.UploadFileSilent(ClientFileName); //Create a new zip file ZipFileName := FileMgt.CreateZipArchiveObject(); // Add the fob file to the zip file FileMgt.AddFileToZipArchive(ServerFileName,FileMgt.GetFileName(ClientFileName)); //Close the zip file FileMgt.CloseZipArchive; //Download the zip file onto the client machine, saving it to the same directory where the //fob file is located, and giving it the same name but with a .zip extension FileMgt.DownloadToFile(ZipFileName, FileMgt.CombinePath(FileMgt.GetDirectoryName(ClientFileName), FileMgt.GetFileNameWithoutExtension(ClientFileName)) + '.zip'); Code <<< NOTE : For the demo above, I used word file type to import. You may use any other files types like .fob (NAV Object Files) , .txt (Text), .xlsx (Excel Files) etc. You just need to replace the parameters in the OpenFileDialog function in the code above. If you want to work with other file types replace the line written below in the code above, //For FOB Files _clientFileName := _fileMgt.OpenFileDialog('Import a FOB file', '', 'FOB Files (*.fob)|*.fob|All Files (*.*)|*.*'); //For Excel Files _clientFileName := _fileMgt.OpenFileDialog('Import a Excel file', '', 'Excel Files (*.xlsx)|*.xlsx|All Files (*.*)|*.*'); That's all for this post! Hope you find this post useful. Do comment your thoughts and doubts in the comments section below. Keep learning!

Forum Post: RE: Dynamics NAV 2016 Purchase Invoice Line Dimension Defaults

$
0
0
When you add dimensions in the page. system checks whether same set/combination of dimensions already available in the Dimension Set ID table. if it exist, system will use the same id, if not system creates new one internally and assign it.

Forum Post: RE: Customer Start Balance Report

$
0
0
hi sindorela use following code CustLedgEntry.RESET; CustLedgEntry.SETCURRENTKEY("Customer No.","Posting Date"); CustLedgEntry.SETRANGE("Customer No.","No."); CustLedgEntry.SETFILTER(CustLedgEntry."posting date",'..%1',startdate); if CustLedgEntry.find('-') then begin Repeat CustLedgEntry.CALCFIELDS(Amount); StartBalance:= StartBalance + CustLedgEntry.Amount; UNTIL CustLedgEntry.NEXT = 0; END; or find my below customization where i have given option on page customer ledger entry to show opening and closing balance of customer TotAmt:=0; OpeningBal:=0; StartDate:=010101D; EndDate:=CALCDATE('-1D',010110D); "Cust.Ledg.Entry".RESET; "Cust.Ledg.Entry".SETCURRENTKEY("Cust.Ledg.Entry"."Customer No.","Cust.Ledg.Entry"."Posting Date"); "Cust.Ledg.Entry".SETRANGE("Cust.Ledg.Entry"."Customer No.","Customer No."); "Cust.Ledg.Entry".SETFILTER("Cust.Ledg.Entry"."Posting Date",'%1..%2',StartDate,EndDate); IF "Cust.Ledg.Entry".FINDFIRST THEN BEGIN REPEAT "Cust.Ledg.Entry".CALCFIELDS("Cust.Ledg.Entry"."Amount (LCY)"); TotAmt :=TotAmt+"Cust.Ledg.Entry"."Amount (LCY)"; OpeningBal:=TotAmt; UNTIL "Cust.Ledg.Entry".NEXT=0; END; EndDate1:=CALCDATE('-1D',010121D); "Cust.Ledg.Entry1".RESET; "Cust.Ledg.Entry1".SETCURRENTKEY("Cust.Ledg.Entry1"."Customer No.","Cust.Ledg.Entry1"."Posting Date"); "Cust.Ledg.Entry1".SETRANGE("Cust.Ledg.Entry1"."Customer No.","Customer No."); "Cust.Ledg.Entry1".SETFILTER("Cust.Ledg.Entry1"."Posting Date",'%1..%2',010110D,EndDate1); IF "Cust.Ledg.Entry1".FINDFIRST THEN BEGIN REPEAT "Cust.Ledg.Entry1".CALCFIELDS("Cust.Ledg.Entry1"."Amount (LCY)"); "Cust.Ledg.Entry1"."Opening Balance":=OpeningBal; "Cust.Ledg.Entry1"."Closing Balance":="Cust.Ledg.Entry1"."Opening Balance"+"Cust.Ledg.Entry1"."Amount (LCY)"; "Cust.Ledg.Entry1".MODIFY; OpeningBal:="Cust.Ledg.Entry1"."Closing Balance"; UNTIL "Cust.Ledg.Entry1".NEXT=0; END;

Forum Post: RE: How to Prevent Negative Inventory on sales order...

$
0
0
hi dhananjay i think you requirement is prevent negative inventory according to posting date . because system not consider posting date.

Blog Post: Adding Logo, privacyStatement and help url's to Extensions using Visual Studio Code

$
0
0
If we would like to add Logo, privacyStatement, help, url and End user License agreement (EULA) links to our extension then we need to fill below settings in app.json file Place the logo in your extension folder and add it to logo settings. I have added sample links in all privacyStatement, help, url and End user License agreement (EULA) setup. You can add proper links as per your scenario. Now Build (Ctrl+Shift+B) the package and Publish (F5). Go to Extensions page and notice logo for our extension. Open extension card and click on any privacyStatement, help, url and End user License agreement (EULA) links which opens links we provided in above setup. We can also enter description of our extension in above setup which is shown in Extension Card. If we don’t set these setup’s in app.json then no links will be opened when we click in extension card and default image is added to extension like

Forum Post: RE: How to Prevent Negative Inventory on sales order...

$
0
0
If you are using NAV2013 then setup is working properly If not working then you can write simple code on Post button for preventing the negative inventory

Forum Post: RE: How to Prevent Negative Inventory on sales order...

Forum Post: RE: How Send XML Document via HTTP Post Using DotNet?

$
0
0
Did you checked this rockwithnav.wordpress.com/.../ OR geekswithblogs.net/.../dynamics-nav-2013-consuming-a-rest-web-service-using-dotnet.aspx OR vjeko.com/.../

Blog Post: From the Microsoft Dynamics NAV Blogs: ZIP files; Access issue; Shop calendar; CRM & NAV Integration

$
0
0
A selection of the latest insight from the Microsoft Dynamics NAV blogs: Import a File and Export It as a ZIP file in NAV 2017 You Do Not Have Access to Microsoft Dynamics NAV Integrating Microsoft Dynamics CRM with Microsoft Dynamics NAV Performance Problem in VM Environment for NAV 2016 and Beyond Import a File and Export It as a ZIP file in NAV 2017 On Ishwar's Blogspot, Ishwar Sharma stated that he did some R&D on the File Management codeunit (419 ...read more

Forum Post: RE: Create copy function

$
0
0
hi, i just got back to this Function and i dont get the ERROR msg anymore. ---- i have code in a Codeunit/function "copyProgramLineNew" ---------------- FUNCTION : CopyProgramLineNew(pFromProgramNo : Code[20];pHeaderCodeNo : Code[20]) : Boolean CODE : FromProgOrderLine.RESET; FromProgOrderLine.SETRANGE("Program No.", pFromProgramNo); IF FromProgOrderLine.FINDSET THEN BEGIN REPEAT ToProgramOrderLine.INIT; ToProgramOrderLine.TRANSFERFIELDS(ProgOrderLine); ToProgramOrderLine."Program No." := pHeaderCodeNo; ToProgramOrderLine.VALIDATE(Type, FromProgOrderLine.Type); ToProgramOrderLine.VALIDATE("No.", FromProgOrderLine."Program No."); ToProgramOrderLine.INSERT(TRUE); UNTIL FromProgOrderLine.NEXT = 0; EXIT(TRUE); END; EXIT(FALSE); --- i created a report/function "SEtSalesProgramHHeader ---------------------------- FUNCTION : SetSalesProgramHeader(VAR NewSalesProgramHeader : Record "Sales Program Header") CODE : SalesProgramHeader := NewSalesProgramHeader and on the Page where i want to show the Copy Document function i have this code : --------------------- FUNCTION : CopyOrderProgramLines - OnAction() CODE: CopyProgramOrderMgtRep.SetSalesProgramHeader(Rec); CopyProgramOrderMgtRep.RUNMODAL; CLEAR(CopyProgramOrderMgtRep); CurrPage.UPDATE(FALSE); i know that i need to call my codeunit inside the report in OnPreReport() but i dont know how. maybe something is missing.

Forum Post: RE: How Send XML Document via HTTP Post Using DotNet?

$
0
0
Many thanks to all, you've been really very kind. I solved.

Forum Post: RE: calc difference between two date

$
0
0
i need to creat a report in classic client , and add a textbox to calc difference between two date ,the report based on table purchas line ,

Forum Post: RE: Dynamics NAV 2016 Purchase Invoice Line Dimension Defaults

$
0
0
Hi Dileepa- Thank you, yes I understand that. This is the scenerio: When I select a vendor on Purchase Invoice. Then I put in the invoice number, I go to detail grid to select G/L Account, after I set No. then check detail dimensions I have two defaulted dimensions, so yes, one ID set entry, but I don't understand, how do I get this ID value from sql? Is it determined on the No. field or the header Vendor field? Or is it a combination or fields? The Dimension Set Entry ID has to be set for Purchase Invoice, but how? Sometimes when I select a different No. such as Fixed Assets not G/L Account, I get four dimensions defaulted, which again means it's a different Dimension Set Entry ID, so I am missing the link to how it knows which Dimension Set Entry ID is to be used? thank you kindly.

Forum Post: RE: Nav hyperlink

$
0
0
Exactly what is your question and requirement? And which version of NAV?

Forum Post: RE: MultiLanguage Editor

$
0
0
"Comment" is a way to communicate to the person who is actually doing the translations. Typically in an external system.
Viewing all 11285 articles
Browse latest View live